Automatic VMSS Upgrade
- Create a VMSS with Image definition set to latest.
- If you have create a image definition with any specific version in VMSS OS=> Change Image Reference
- Now open cloud shell and execute CLI/Powershell Command
Update-AzVmss -ResourceGroupName "<rg -name >" -VMScaleSetName "<vmss name>" -AutomaticOSUpgrade $true
# or
az vmss update --name "<vmss name>" --resource-group "<rg -name >" --set UpgradePolicy.AutomaticOSUpgradePolicy.EnableAutomaticOSUpgrade=true
* Ensure Upgrade policy is automatic or rolling update
* Now create a new version of the image which will be latest and see the rolling update or automatic update in action.
* If your organization automates the process of image creation and configures VMSS to pick latest versions, this is easier deployment option. This kind of infrastructure is referred as immutable infrastructure.
