Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
Azure Virtual Machine Scale Sets are the Azure service for automating and managing custom scalable VM-based infrastructure.
Key capabilities:
- Create and manage a group of load-balanced VMs.
- Automatically increase or decrease instance count based on demand, schedules, metric thresholds, or predictive usage patterns.
- Improve availability and resiliency by distributing instances across availability zones or fault domains.
- Keep VM instances consistent by using the same base OS image and configuration.
Recommended design choice:
- Use Flexible orchestration for new workloads. It is the recommended mode and supports high availability, mixed VM types, Spot and on-demand VMs, and key scale set features such as metrics-based autoscaling, instance protection, standby pools, and upgrade policies.
- The orchestration mode is set when the scale set is created and cannot be changed later.
Ways to automate and manage the infrastructure:
- Manual or scripted scaling
- Azure portal: Virtual machine scale set → Settings → Scaling → choose Manual Scale → update Instance count → Save.
- Azure CLI:
az vmss scale --new-capacity 5 --name scaleSetName --resource-group resourceGroupName - Azure PowerShell:
Update-AzVmss -SkuCapacity 5 -ResourceGroupName resourceGroupName -VMScaleSetName scaleSetName
- Inspect and manage scale set configuration
- Azure CLI:
az vmss show --resource-group myResourceGroup --name myScaleSet - Azure PowerShell:
Get-AzVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet"
- Azure CLI:
- Autoscale the environment
- Scale by:
- manual capacity changes
- schedules
- metric threshold rules
- predictive AI-based usage patterns
- Autoscaling requires the scale set to be defined with a virtual machine scaling profile.
- Scale by:
- Standardize application deployment across instances
- Use VM Applications to create and deploy applications to scale set instances.
- Use a custom VM image when instances should be ready with the application immediately after provisioning.
- Use the Custom Script Extension for post-deployment configuration, software installation, or other management tasks.
Practical architecture approach:
- Build the scale set with Flexible orchestration.
- Define a common VM image or deployment method so all instances are consistent.
- Add autoscale rules for demand-based growth and reduction.
- Use CLI or PowerShell for lifecycle automation and operational scripts.
- Use VM Applications, custom images, or Custom Script Extension to keep application rollout repeatable across all instances.
- What are Virtual Machine Scale Sets?
- Overview of autoscale with Azure Virtual Machine Scale Sets
- Orchestration modes for Virtual Machine Scale Sets in Azure
- Manage a Virtual Machine Scale Set with the Azure CLI
- Manage a Virtual Machine Scale Set with Azure PowerShell
- Deploy your application on Virtual Machine Scale Sets