microscopic-furniture-52860
10/19/2022, 2:39 PMaz storage file upload
but would like an update to be triggered if the file contents changes. I could possibly hack around this by changing the filename each time, but that’s not ideal and easily forgotten.
Unfortunately this doesn’t look like it’s supported in the spec even though it was in az classic: https://pulumi-community.slack.com/archives/C84L4E3N1/p1648163487694929?thread_ts=1648066957.732819&cid=C84L4E3N1
I briefly looked into a Dynamic Provider but that’s not supported in dotnet. Any suggestions welcome 🙂public static Command UploadFile(string commandName, Input<string> fileShareName,
Input<string> storageAccountName, Input<string> storageKey,
Input<string> sourceFile, Input<string> fileHash,
Input<string> destinationFile)
{
const string uploadCommand =
"az storage file upload -s $STORAGE_SHARE_NAME --source $SOURCE_FILE --account-key $STORAGE_ACCOUNT_KEY --account-name $STORAGE_ACCOUNT_NAME -p $DESTINATION_PATH";
const string deleteCommand =
"az storage file delete -s $STORAGE_SHARE_NAME --account-key $STORAGE_ACCOUNT_KEY --account-name $STORAGE_ACCOUNT_NAME -p $DESTINATION_PATH";
return new Command(commandName, new CommandArgs
{
Create = uploadCommand,
Update = uploadCommand,
Delete = deleteCommand,
Environment =
{
{ "STORAGE_SHARE_NAME", fileShareName },
{ "STORAGE_ACCOUNT_NAME", storageAccountName },
{ "STORAGE_ACCOUNT_KEY", storageKey },
{ "SOURCE_FILE", sourceFile },
{ "HASH", fileHash },
{ "DESTINATION_PATH", destinationFile }
}
});
}