sparse-intern-71089
10/19/2022, 2:39 PMmicroscopic-furniture-52860
10/19/2022, 3:47 PMpublic 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 }
}
});
}