is extension supposed to only work once?
I see similar behavior with Windows and Linux customscript, looks like the first run result is cached and following run just show first run's result.
for example, I have a json file
cat script-centos.json
{
"fileUris": ["https://mystorageshare.blob.core.windows.net/publicshare/centos.sh"],
"commandToExecute": "sh ./centos.sh"
}
When I run
az vm extension set -g rg --vm-name centosvm1 --name CustomScriptForLinux --publisher Microsoft.OSTCExtensions --settings script-centos.json --protected-settings "{}"
the first time, I got error "The specified blob does not exist", cause I forgot to upload centos.sh to the storage account. then I uploaded it and rerun the command, still got the same error even when the file is there now.
To make it work, I need to delete the previous extension first: az vm extension delete -g rg --vm-name centosvm1 --name CustomScriptForLinux
then it will work.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 2ebbeb5f-6ab6-3fb3-c969-5d935e60f251
- Version Independent ID: 9d4169c9-f5b5-512a-8061-2234d6dec1eb
- Content: az vm extension
- Content Source: src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_help.py
- Service: virtual-machines
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
CRP will not re-provision the extension if the configuration has not changed, to overturn this behavior , make sure you supply the argument of --force-update
please activate the issue if the flag doesn't help