az vmss create supports automatic availability-zone placement controls
Introduced 2026-04-07 · score 0.94
HOW TO USE IT
When creating a VM scale set with automatic zone placement, set `--zone-placement-policy Auto`; optionally constrain eligible zones or their maximum count. `--include-zones` and `--exclude-zones` cannot be used together.
az vmss create --resource-group <resource-group> --name <scale-set-name> --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys --instance-count 3 --zone-placement-policy Autoaz vmss create --resource-group <resource-group> --name <scale-set-name> --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys --instance-count 3 --zone-placement-policy Auto --include-zones 1 2WHY THIS HELPS
Create a VM scale set with automatic zone placement constrained by selected zones and a zone count.
REQUIREMENTS AND LIMITATIONS
- Version: 2.85.0
- --resource-group (required): Name of an existing resource group.
- --name (required): Scale set name.
- --image (required): OS image name, URN, custom image name or ID, or VHD blob URI; required unless using `--attach-os-disk`.
- --zone-placement-policy: Set to `Auto` to enable automatic availability-zone placement.
- --include-zones: Availability zones to consider; if omitted, all regional zones are considered. Mutually exclusive with `--exclude-zones`.
- --exclude-zones: Availability zones to exclude; if omitted, no zones are excluded. Mutually exclusive with `--include-zones`.
- --max-zone-count: Maximum number of availability zones to use with automatic placement; if omitted, all available regional zones may be used.
- --admin-username (required): Administrator username for the example Linux VM.
- --generate-ssh-keys: Generate SSH key files if missing; stores them in `~/.ssh`.
- --instance-count: Number of VMs in the scale set; default is 2.
- Prerequisite: Register the `Microsoft.Compute/VmssAutomaticZonePlacement` feature for the subscription. The feature is marked Preview in the official documentation.
- Prerequisite: The resource group must already exist.
- `--include-zones`, `--exclude-zones`, and `--max-zone-count` apply when `--zone-placement-policy` is set to `Auto`.
- Docs conflict: `--include-zones` and `--exclude-zones` cannot both be configured on the same scale set; the card's optional-flag wording could be read as allowing both together.
FIRST-PARTY EVIDENCE
- https://learn.microsoft.com/en-us/cli/azure/release-notes-azure-cli#april-07-2026
- https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-zone-placement
- https://learn.microsoft.com/en-us/cli/azure/vmss
Check the installed version and the source before using it. Entry JSON