Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
By using customer-selected availability zones, you specify the zones that a Virtual Machine Scale Set can use by setting the zones property. You can select one zone for a zonal deployment or multiple zones for a zone-spanning deployment.
Use customer-selected zones when your workload must use specific availability zones. If you want Azure to select zones based on capacity and SKU availability, consider automatic zone placement.
Prerequisites
- Create the scale set in an Azure region that supports availability zones.
- Verify that your VM size and disk types are available in the zones that you want to use. Use the Compute Resource SKUs API to determine which sizes are available in each zone.
Create zone-spanning or zonal scale sets
When you deploy a Virtual Machine Scale Set, you can choose to use a single availability zone in a region, or multiple zones.
You can create a scale set that uses availability zones by using one of the following methods:
Use the Azure portal
The process to create a scale set that uses an availability zone is the same as detailed in the getting started article. When you select a supported Azure region, you can create a scale set in one or more available zones, as shown in the following example:

The scale set and supporting resources, such as the Azure load balancer and public IP address, are created in the single zone that you specify.
Use Azure CLI
The process to create a scale set that uses an availability zone is the same as detailed in the getting started article. To use availability zones, create your scale set in a supported Azure region.
Add the --zones parameter to the az vmss create command and specify which zone to use (such as zone 1, 2, or 3).
az vmss create \
--resource-group myResourceGroup \
--name myScaleSet \
--image <SKU Image> \
--upgrade-policy-mode automatic \
--admin-username azureuser \
--generate-ssh-keys \
--zones 1 2 3
It takes a few minutes to create and configure all the scale set resources and VMs in the zone(s) that you specify. For a complete example of a zone-redundant scale set and network resources, see this sample CLI script
Use Azure PowerShell
To use availability zones, create your scale set in a supported Azure region. Add the -Zone parameter to the New-AzVmssConfig command and specify which zone or zones to use (such as zone 1, 2, or 3).
New-AzVmss `
-ResourceGroupName "myResourceGroup" `
-Location "EastUS2" `
-VMScaleSetName "myScaleSet" `
-VirtualNetworkName "myVnet" `
-SubnetName "mySubnet" `
-PublicIpAddressName "myPublicIPAddress" `
-LoadBalancerName "myLoadBalancer" `
-UpgradePolicy "Automatic" `
-Zone "1", "2", "3"
Use an Azure Resource Manager template
The process to create a scale set that uses an availability zone is the same as detailed in the getting started article for Linux or Windows.
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "myScaleSet",
"location": "East US 2",
"apiVersion": "2017-12-01",
"zones": [
"1",
"2",
"3"
]
}
If you create a public IP address or a load balancer, specify the "sku": {"name":"Standard"} property to create zone-redundant network resources. You also need to create a Network Security Group and rules to permit any traffic. For more information, see Azure Load Balancer Standard Overview and Standard Load Balancer and Availability Zones.
Update a scale set to add availability zones
You can modify a scale set to expand the set of zones over which to spread VM instances. Expanding the set of zones allows you to take advantage of a higher availability SLA (99.99%) versus regional (nonzonal) availability SLA (99.95%). Or expand your scale set to take advantage of new availability zones that weren't available when you created the scale set.
This feature can be used with API version 2023-03-01 or greater.
Expand scale set to use availability zones
You can update the scale set to scale out instances to one or more additional availability zones, up to the number of availability zones supported by the region. For regions that support zones, the minimum number of zones is three.
Important
When you expand the scale set to additional zones, the original instances are not migrated or changed. When you scale out, new instances will be created and spread evenly across the selected availability zones. Data from the original instances are not migrated to the new zones. When you scale in the scale set, any regional (nonzonal) instances will be priorized for removal first. After that, instances will be removed based on the scale in policy.
Expanding to a zone-spanning scale set is done in three steps:
- Prepare for zone expansion
- Update zones parameter on the scale set
- Add new zonal instances and remove original instances
Prepare for zone expansion
Warning
This feature allows you to add zones to the scale set. You can't go back to a regional (nonzonal) scale set or remove zones once you add them.
To prepare for zone expansion:
- Check that you have enough quota for the VM size in the selected region to handle more instances.
- Check that the VM size and disk types you use are available in all the desired zones. Use the Compute Resources SKUs API to determine which sizes are available in which zones.
- Validate that the scale set configuration is valid for zonal and zone-spanning scale sets:
- Set
platformFaultDomainCountto 1 or 5. Fixed spreading with 2 or 3 fault domains isn't supported for zonal and zone-spanning scale sets. - Capacity reservations are not supported during zone expansion. Once the scale set is fully zone-spanning or zonal (no more regional (nonzonal) instances), you can add a capacity reservation group to the scale set.
- Azure Dedicated Host deployments are not supported.
- Set
Update the zones parameter on the scale set
Update the scale set to change the zones parameter.
- Navigate to the scale set you want to update
- On the Availability tab of the scale set landing page, find the Availability zone property and select Edit.
- In the Edit Location dialog box, select the zones you want.
- Select Apply.
Add new zonal instances and remove original instances
You can manually balance your scale set across zones by triggering a scale-out operation and then scaling in. For more details, see How to manually balance your scale set.
Known issues and limitations
The original instances are not migrated to the newly added zones. Your workload must handle any required data migration or replication.
Scale sets running Service Fabric RP or Azure Kubernetes Service are not supported.
You can't remove or replace zones, only add zones
You can't update from a zone spanning or zonal scale set to a regional (nonzonal) scaleset.
platformFaultDomainCountmust be set to 1 or 5. Fixed spreading with 2 or 3 fault domains isn't supported for zone-spanning or zonal deployments.Capacity reservations are not supported during zone expansion. Once the scale set is fully zone-spanning or zonal (no more regional (nonzonal) instances), you can add a capacity reservation group to the scale set.
Azure Dedicated Host deployments are not supported
Next steps
Now that you have created a scale set in an availability zone, you can learn how to Deploy applications on Virtual Machine Scale Sets or Use autoscale with Virtual Machine Scale Sets.