Set the upgrade policy mode on Virtual Machine Scale Sets
Article 12/20/2024
2 contributors
Feedback
In this article
The upgrade policy mode can be set during scale set creation or changed post deployment. If you don't explicitly set the upgrade policy mode, it defaults to manual. To change the upgrade policy mode of an existing scale set deployment, see changing the upgrade policy mode .
During the Virtual Machine Scale Set creation in the Azure portal, under the Management tab, set the upgrade policy to Rolling , Automatic , or Manual .
When creating a new scale set using Azure CLI, use az vmss create and the -upgrade-policy-mode
to set the upgrade policy mode.
az group create --name myResourceGroup --location chinanorth2
az vmss create \
--resource-group myResourceGroup \
--name myScaleSet \
--orchestration-mode Flexible \
--image Ubuntu2204 \
--lb myLoadBalancer \
--upgrade-policy-mode manual \
--instance-count 5 \
--admin-username azureuser \
--generate-ssh-keys
When creating a new scale set using Azure PowerShell, use New-AzVmss and the -UpgradePolicyMode
parameter to set the upgrade policy mode.
New-AzResourceGroup -Name "myResourceGroup" -Location "chinanorth2"
New-AzVmss `
-ResourceGroupName "myResourceGroup" `
-Location "chinanorth2" `
-VMScaleSetName "myScaleSet" `
-OrchestrationMode "Flexible" `
-VirtualNetworkName "myVnet" `
-SubnetName "mySubnet" `
-PublicIpAddressName "myPublicIPAddress" `
-LoadBalancerName "myLoadBalancer" `
-UpgradePolicyMode "Manual"
When using an ARM template, add the upgradePolicy
parameter to the properties section of your template to set the upgrade policy mode.
"properties": {
"upgradePolicy": {
"mode": "manual",
}
}
Next steps
Learn how to change the upgrade policy mode of your Virtual Machine Scale Set.