Deploy and Configure an Azure VM Scale Set

Lab overview

A VM Scale Set is an Azure compute resource that allows you to deploy and manage a set of identical VMs. This lab walks you through the process of setting up the scale set, configuring auto-scaling based on CPU usage, and attaching storage to the VMs. You'll also configure network settings and management options to ensure smooth operations.

By the end of this lab, you'll have deployed a scalable, flexible infrastructure capable of automatically scaling in or out based on workload demands.

Why you'd do this

A single VM is a single point of failure and a fixed amount of capacity. A Virtual Machine Scale Set solves both problems at once: it keeps a pool of identical VMs behind one configuration, adds instances when demand climbs, removes them when it drops, and spreads them across fault domains or availability zones so one hardware failure doesn't take the workload down. You reach for a scale set whenever you have a stateless tier — web front ends, API servers, batch workers — that needs to handle traffic you can't predict.

The autoscale rules are where the money is. Scaling out at 75% CPU and back in at 25% means you pay for three instances only during the spike and for one the rest of the day. Setting the thresholds too close together causes "flapping," where the set constantly adds and removes VMs; the 50-point gap in this lab is a sensible default. The scale-in policy decides which instance gets removed first, and the default (newest, then by zone balance) is what you want unless you have a reason to protect specific instances.

Two settings here are deliberately conservative. Pinning to a single availability zone keeps the lab simple, but in production you'd pick two or three zones so a datacenter outage leaves the set running. And the Manual upgrade mode means new images or extension changes don't roll out automatically — you push them when you're ready — which is safer while you're learning and common for workloads that can't tolerate surprise restarts.

For certification prep, this is squarely in the AZ-104 compute objectives (deploy and manage scale sets, configure autoscaling) and shows up in AZ-305 when you're asked to design a scalable or highly available compute solution.

Lab details

  • Scale Set Name: vmss01 in resource group ProdRG
  • VM Size: Standard_D2s_v3
  • Availability Zone: Zone 1 · Security type: Standard
  • Initial instances: 1 · Max instances: 3
  • Scale out at: 75% CPU · Scale in at: 25% CPU
  • Data Disk: 8 GiB · Performance tier: P10
  • Upgrade mode: Manual

Learning objectives

  1. Understand how to create and configure an Azure Virtual Machine Scale Set.
  2. Learn how to configure availability zones for high availability.
  3. Gain hands-on experience configuring auto-scaling rules based on CPU utilization.
  4. Set up and manage storage options for the virtual machines in the scale set.
  5. Configure networking and security settings for the VM Scale Set.
  6. Review and deploy a fully configured VM Scale Set, and learn how to monitor and manage it post-deployment.

Exam relevance

  • AZ-104 — Azure Administrator — Deploy and manage VM Scale Sets, Configure autoscaling, Manage VM storage and networking.
  • AZ-305 — Azure Solutions Architect — Design scalable compute solutions, Plan high availability infrastructure, Implement auto-scaling strategies.

Step-by-step instructions

  1. Log into the Azure Portal and click Create a resource.
  2. Search for and select Virtual machine scale set:
    • Type scale set in the search bar and press Enter.
    • Click Virtual machine scale set from the results.
    • Click Create to begin configuration.
  3. Configure the basics:
    • Select resource group ProdRG.
    • Enter vmss01 as the scale set name.
    • Set Availability zone to Zone 1.
    • Set Security type to Standard.
  4. Configure Autoscaling:
    • Select Autoscaling and click Configure.
    • Set initial instance count to 1.
    • Set max instance count to 3.
    • Set CPU threshold to scale out to 75%.
    • Set CPU threshold to scale in to 25%.
    • Click Save.
  5. Set the Scale-in policy:
    • Select Default from the dropdown.
    • Click Save.
  6. Select VM size Standard_D2s_v3.
  7. Set up administrator credentials:
    • Username: vmadmin
    • Password: Password123!~
  8. Click Next: Disks and configure storage:
    • Click Create and attach a new disk.
    • Set size to 8 GiB.
    • Set performance tier to P10.
    • Click OK.
  9. Click Next: Networking to review defaults, then Next: Management:
    • Set Upgrade mode to Manual.
  10. Click through Health, Advanced, and Tags without changes.
  11. Click Review + create, review the settings, then click Create.
  12. Wait for deployment to complete, then click Go to resource to access the VM Scale Set.

An Introduction to Microsoft Entra ID

Learn what you need to know to get started with Microsoft Entra ID with this easily-digestible 5-hour bootcamp from best-selling instructor, Thomas Mitchell.

Disable these ads by becoming a labITpro Supporter!

Azure vNets Explained

Want to learn about Azure virtual networks? In this quick-hitting explanation, you’ll learn what they are, what they do, and you’ll learn about key Azure vNet features.

Disable these ads by becoming a labITpro Supporter!