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 groupRGHA with the name VMSSHA01, using Availability Zones and Uniform orchestration. The screenshots follow the exact workflow in the Azure portal.

- 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.

- 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.

- 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.

- 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.

- 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.

- 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).
- Advanced options: enable features such as scaling beyond 100 instances and strict distribution/spreading across Availability Zones.

- Review + Create: validate settings and create the scale set. Azure will provision the initial instances and the VMSS resource.

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.
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.


Generating load to test autoscale
On the VMSS instance, update packages and install a load generator such asstress:
stress example usage (from stress --help):
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.

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.
Links and references
- Azure Virtual Machine Scale Sets documentation
- Azure Autoscale documentation
- Azure Load Balancer overview