https://pulumi.com logo
#azure
Title
# azure
f

fast-vr-6049

08/01/2023, 4:25 PM
@worried-knife-31967 It's not built-in to Pulumi, so I had to implement this myself in the past. Here's the code I used! It's not commented or anything, but hopefully it's reasonably self-explanatory. To invoke it, you just need to use an
Output.Tuple()
containing all the parameters, then inside the
.Apply(tuple =>
lambda, invoke the method using standard
async
and
await
methods. I haven't tested it in a while, but it should just work!
w

worried-knife-31967

08/01/2023, 4:30 PM
I was going to do something similar, my issue is that it uploads on every run that way, not just if the file has changed. it would be cool to be able to have some kind of extension to FileAsset that would do that.
f

fast-vr-6049

08/01/2023, 4:31 PM
I want to think that
FileAsset
actually does do that. I've observed
FileAsset
mentioning gathering file hashes in the past, which is why I think that. I bet you could probably write a small custom provider wrapper around this code that makes use of
FileAsset
to implement that functionality. But, if you're okay with uploading the file every time you run
pulumi up
, then this'll cover you 🙂
w

worried-knife-31967

08/01/2023, 4:50 PM
I'm now playing with Pulumi Command... it would be great to have that, but it accepts a method to run, or an API to call.