Skip to main content
This article explains how scaling works in Azure and walks through deploying a Virtual Machine Scale Set (VMSS) from the Azure portal. It keeps the original step order and images while improving clarity and SEO-relevance.

What is scaling in Azure?

Azure supports two scaling strategies:
  • Vertical scaling (scale up / scale down): increase or decrease the capacity of a single resource (for example, changing a VM to a larger or smaller size). This can be limited by the maximum instance size and may require downtime.
  • Horizontal scaling (scale out / scale in): change the number of instances. Adding instances is scale out; removing instances is scale in. Virtual Machine Scale Sets provide horizontal scaling.

Virtual Machine Scale Sets (VMSS) overview

VMSS are used to create and manage a group of load-balanced VMs that can automatically scale based on schedules, metrics, or manually on demand. Key features:
  • Integration with Azure Load Balancer and Application Gateway.
  • Autoscale by schedule or metrics (CPU, memory via diagnostics, custom metrics).
  • Uniform orchestration: all instances are identical (same image and size).
  • Flexible orchestration: supports mixing VM sizes and types within a scale set.
  • Distribution across Availability Zones for higher availability.
  • Default maximum instances per scale set: 1,000 for most images (some scenarios like managed images or specific SKUs may have lower practical limits—commonly around 600).
Choose the orchestration mode carefully: Uniform requires identical VM sizes and images, while Flexible lets you mix VM types and sizes for more flexible deployments.

Deploying a VMSS from the Azure portal — step by step

Below is a step-by-step example creating a VMSS in resource group RGHA with the name VMSSHA01, using Availability Zones and Uniform orchestration. The screenshots follow the exact workflow in the Azure portal.
A screenshot of the Microsoft Azure portal showing the "Create a virtual machine scale set" page. The form displays fields like Resource group (rg-ha-01), scale set name (vmss-ha-01), region (East US), orchestration mode options, and the selected image (Ubuntu Server 20.04 LTS).
  1. Basic settings: select subscription, resource group (RGHA / rg-ha-01), scale set name (VMSSHA01 / vmss-ha-01), region and orchestration mode. Choose the OS image and VM size.
Next, configure the administrator credentials and confirm the VM size if needed.
A screenshot of the Microsoft Azure portal showing the "Create a virtual machine scale set" form. It displays options like the selected image (Ubuntu Server 20.04 LTS), VM architecture and size, and administrator account settings.
  1. Spot instances: if you want to use Spot VMs to save cost, configure eviction policy and max price. In this demo, Spot instances are not used.
A screenshot of the Microsoft Azure portal on the "Create a virtual machine scale set" page, open to the "Spot" tab showing Spot/eviction options like eviction type, maximum price per hour, and eviction policy. Navigation buttons ("Review + create", "< Previous", "Next: Disks >") and the Azure header are visible.
  1. Disks: choose OS disk type (Standard SSD in this example) and configure disk encryption or size as needed. The VMSS workflow will present similar disk options as for single VMs but applied across the set.
A screenshot of the Microsoft Azure portal on the "Create a virtual machine scale set" page, open to the "Disks" tab. The UI shows VM disk encryption, OS disk size/type, key management, and navigation buttons (Review + create, Previous, Next).
  1. Networking: choose the virtual network (VNet) and network interface settings. Decide whether instances get public IPs (not recommended for scale set instances) or remain private behind a jump host or bastion.
A screenshot of the Microsoft Azure portal on the "Create a virtual machine scale set" Networking tab showing a virtual network dropdown list and network interface options. A Microsoft Edge "Update password" popup is visible in the top-right.
Load balancing options let you attach an Azure Load Balancer or Application Gateway to the scale set. In this demo the load balancing is initially set to none.
  1. Scaling tab: configure autoscale behavior — initial instance count, min/max instances, and autoscale rules. For example, use CPU threshold rules to add or remove instances automatically.
A screenshot of the Microsoft Azure portal showing the "Create a virtual machine scale set" page with the Scaling tab open, including fields for initial instance count, min/max instances, and CPU thresholds. A small Microsoft Edge "Update password" popup is visible in the upper-right.
Example autoscale configuration used in this demo:
  • Rule: If CPU usage remains above 75% for 10 minutes, increase instance count by 1.
  • Rule: After a cooldown period, if CPU drops to 25% or below, decrease instance count by 1.
  • Set minimum and maximum instance counts to enforce capacity boundaries (for example min=1, max=10).
  1. Advanced options: enable features such as scaling beyond 100 instances and strict distribution/spreading across Availability Zones.
A screenshot of the Microsoft Azure portal showing the "Create a virtual machine scale set" page (Advanced tab). It displays allocation policy options (enable scaling beyond 100 instances, spreading algorithm), sections for extensions and VM applications, and navigation buttons like "Review + create."
  1. Review + Create: validate settings and create the scale set. Azure will provision the initial instances and the VMSS resource.
A screenshot of the Microsoft Azure portal on the "Create a virtual machine scale set" Review + create page showing validation passed and a summary of settings (subscription, resource group, region, image, size, etc.). A notification in the corner says "Initializing deployment..." for the resource group rg-ha-01.

Verifying instances and connecting

After deployment completes, open the VMSS resource and view the Instances blade. Autoscale rules may immediately adjust the instance count based on observed load or schedules.
Screenshot of the Microsoft Azure portal showing the "vmss-ha-01" virtual machine scale set Instances page. It lists one instance (vmss-ha-01_1) with computer name vmss-ha-0000001, status "Running" and provisioning state "Succeeded."
Select an instance to see its overview, private IP, connection options, and monitoring charts. Note that VMSS instances are usually assigned private IPs only—use a jump host or Azure Bastion for remote access.
By default, VMSS instances typically have private IP addresses only. Plan to use a jump host, Azure Bastion, or load balancer with NAT rules if you need remote access.
A screenshot of the Microsoft Azure portal showing the overview page for a virtual machine scale set instance (vmss-ha-01_1), with a Connect dropdown (SSH/RDP/Bastion), instance details (private IP, location, provisioning state), and a CPU usage chart.
If you need a public IP to reach the VNet, create or identify a jump host with a public IP and use it to access the VMSS instance via its private IP.
Screenshot of the Microsoft Azure portal showing the "az-vm-01-vnet | Connected devices" page. It lists two connected devices (a network interface and a scale set instance) with IPs 10.0.0.4 and 10.0.0.6 on the "default" subnet.
Example SSH flow using a jump host:

Generating load to test autoscale

On the VMSS instance, update packages and install a load generator such as stress:
stress example usage (from stress --help):
To generate sustained CPU load for 10 minutes (600 seconds) and show verbose output:
On a separate session, run htop on the VMSS instance to confirm CPU utilization is high. Sample htop-style output (trimmed):

Monitoring autoscale events

After the autoscale rule window elapses (for example 10 minutes above 75% CPU), the autoscale engine will add instances automatically. The portal monitoring charts will show the CPU spike and autoscale behavior.
Screenshot of the Microsoft Azure portal for a virtual machine scale set instance (vmss-ha-01_1) showing monitoring charts. The CPU usage graph shows a sharp rise to about 95–96%.
You can also watch the Activity Log for autoscale events such as “Autoscale scale up initiated” showing the instance count increasing.
A Microsoft Azure portal screenshot showing the vmss-ha-01 virtual machine scale set Activity log with an "Autoscale scale up initiated" event. The details indicate the autoscale engine is increasing the instance count (from 1 to 2).
In this demo the scale set scaled up to the configured maximum (for example, up to 10 instances). When load decreases, the autoscaler will scale in according to rules, but it will not go below the configured minimum.

Best practices and summary

  • Bake your base image with the application installed and use it for VMSS to shorten provisioning time.
  • Put a load balancer or application gateway in front of the scale set so traffic is distributed and instances can be health-probed.
  • Configure autoscale rules with sensible thresholds, cooldowns, and min/max instances to avoid rapid scale churn.
  • Prefer Uniform orchestration for identical workloads and Flexible for mixed VM families or single-instance VMs in a group.
  • Use a jump host or Azure Bastion for secure access to private-only VMSS instances.
This completes the VMSS deployment and management walkthrough. Azure PaaS solutions and additional autoscale strategies (for example Azure Monitor autoscale with custom metrics) will be covered in a separate article.

Watch Video