https://pulumi.com logo
#general
Title
# general
b

billowy-vr-96461

02/08/2022, 4:33 PM
How do I make pulumi re-generate a random id only if a given resource has changed? I'm using Azure and Azure Functions will take a long time to notice that my function's code has changed if I don't change the blob's file name, but I don't want to upload a new version if nothing in my code has changed.
e

echoing-dinner-19531

02/08/2022, 4:45 PM
A random ID using the RandomId resource? Or something else? If your using the RandomId resource then it have a look at the
keepers
parameter: https://www.pulumi.com/registry/packages/random/api-docs/randomid/#keepers_nodejs
b

billowy-vr-96461

02/08/2022, 6:34 PM
But I would have to change this variable (I'd) manually, right? I don't have a way of doing that. I could use the hash of the archive generated by FileArchive and use that as an id, but I don't think Pulumi allows that.
e

echoing-dinner-19531

02/08/2022, 6:52 PM
but I don't want to upload a new version if nothing in my code has changed
I'm pretty sure Pulumi will be doing this for you anyway. I don't think you need to be duplicating these checks.
b

billowy-vr-96461

02/08/2022, 8:36 PM
Azure is taking a long time to notice that the zip file, which has the same name as before, now has a different content. That's my main issue: Azure Functions take a long time to notice a change if I keep the file name the same.
e

echoing-dinner-19531

02/09/2022, 10:50 AM
One suggestion to try is setting replaceOnChanges="source" on the blob so it gets recreated when your content changes, that should give it a new name which hopefully triggers the azure function to pick it up faster.
2 Views