Virtual Machine Scale Set

Nelson Narayan 20 Reputation points
2026-08-25T21:49:17.8833333+00:00

How to automate, and manage custom scalable Azure VM based Infrastructure solutions

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets

Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.

0 comments No comments

2 answers

Sort by: Most helpful
  1. AI answer

    2026-08-25T21:49:34.0466667+00:00

    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:

    1. Manual or scripted scaling
      • Azure portal: Virtual machine scale set → SettingsScaling → choose Manual Scale → update Instance countSave.
      • Azure CLI:
             az vmss scale --new-capacity 5 --name scaleSetName --resource-group resourceGroupName
        
      • Azure PowerShell:
             Update-AzVmss -SkuCapacity 5 -ResourceGroupName resourceGroupName -VMScaleSetName scaleSetName
        
    2. Inspect and manage scale set configuration
      • Azure CLI:
             az vmss show --resource-group myResourceGroup --name myScaleSet
        
      • Azure PowerShell:
             Get-AzVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet"
        
    3. 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.
    4. 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.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.
  2. Marcin Policht 104.3K Reputation points MVP Volunteer Moderator
    2026-08-25T22:03:40.9533333+00:00

    Azure VM Scale Sets allow you to automate, deploy, and centrally manage a scalable group of Azure virtual machines. Instead of managing individual VMs, you define the VM configuration, image, networking, security, storage, and scaling requirements once, and Azure manages the individual instances. VMSS is commonly used for web servers, application servers, batch processing, container workloads, and other infrastructure that requires multiple VMs with consistent or controlled configurations.

    VMSS supports two orchestration modes: Uniform and Flexible. Uniform orchestration is designed for large-scale workloads where instances are essentially identical. You define a single VM model, and VMSS creates instances from that model. It provides simplified scaling and centralized management and is well suited to stateless applications where individual VM identity is generally unimportant. Uniform VMSS can automatically add or remove instances based on autoscale rules and workload demand.

    Flexible orchestration provides more control over individual VM instances while still allowing them to be managed as part of a scale set. You can use different VM sizes, images, or configurations within the same scale set and manage instances more independently. Flexible orchestration is therefore better suited to more complex infrastructure solutions where VMs may have different roles or configurations, while still benefiting from VMSS capabilities such as scaling, health monitoring, and automated repairs.

    For custom infrastructure, VMSS can use Azure Compute Gallery images or custom images to provide a standardized operating system and application configuration. Extensions, cloud-init, or startup scripts can then perform additional configuration when instances are provisioned. This allows new instances to be automatically configured without manually installing software or applying settings to each VM.

    VMSS can integrate with Azure Load Balancer and Application Gateway to distribute incoming traffic across instances. Azure Autoscale can increase or decrease the number of instances based on CPU utilization, application metrics, schedules, or other supported metrics. This provides elasticity, allowing capacity to increase during periods of high demand and decrease when demand falls.

    VMSS also provides lifecycle management capabilities such as automatic instance repairs, health monitoring, rolling upgrades, and automatic replacement of unhealthy instances. These capabilities help maintain application availability while reducing the amount of manual VM administration required.

    The entire environment can be automated using Azure CLI, PowerShell, Bicep, ARM templates, or Terraform. Infrastructure as Code can define the VMSS, VM images, networking, load balancing, autoscale rules, managed identities, extensions, and other dependencies, making deployments repeatable and easier to maintain across development, testing, and production environments.

    In practice, Uniform VMSS is generally the better choice when you need a large pool of essentially identical VMs and straightforward horizontal scaling, while Flexible VMSS is preferable when you need greater control over individual VMs, mixed VM configurations, or more complex infrastructure architectures.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.