Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Azure icon
Labs

Deploy an Azure VM Scale Set with Load Balancing

Welcome to the Deploy a VM Scale Set with Load Balancing lab. In this lab, we will cover three objectives: 1. Use an existing subnet as a data source 1. Create and configure an Azure load balancer 1. Create and configure an Azure VM Scale Set By the end of this lab, you will have created an Azure VM Scale Set and load balancer using Terraform and a module from the public registry.

Azure icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 23, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Use an Existing Subnet as a Data Source

    In this objective, you'll add a existing Azure subnet as a data source to your Terraform configuration. This subnet will be used for the network interfaces of the VM Scale Set.

    1. Log into the Azure CLI using the provided credentials
    2. Retrive the name of the provided resource group and virtual network.
    3. Create a new Terraform configuration using the azurerm.
    4. Set skip_provider_registration to true for the azurerm provider block.
    5. Create data sources for the existing resource group and subnet named web.
    6. Create the necessary input variables and terraform.tfvars file.
    7. Add an output to display the subnet ID.
    8. Deploy the configuration and verify the correct output is displayed in the terminal.
  2. Challenge

    Create and Configure an Azure Load Balancer

    In this objective, you will add a public-facing Azure load balancer using the module from the public registry. The load balancer should listen on port 80 for traffic and send it to the application port defined for the VM Scale Set. The health probe should sent an HTTP request to the "/" path on the application port defined for the VM Scale Set.

    1. Add the load balancer module to your configuration using the existing resource group provided by the lab, with the following values:
      • type = "public"
      • pip_sku = "Standard"
      • allocation_method = "Static"
      • lb_sku = "Standard"
    2. Add an lb_port entry listening on port 80 and sending traffic to the defined application port.
    3. Add an lb_probe entry the checks the path "/" on the defined application port.
    4. Validate and deploy the configuration.
  3. Challenge

    Create and configure an Azure VM Scale Set

    In this objective, you will add an Azure VM Scale Set and network security group to the configuration using the provided subnet and startup script. The network security group should allow traffic from anywhere on the defined application port.

    1. Add an azurerm_network_security_group and azurerm_network_security_rule to the configuration. The rule should allow TCP traffic from any source address and port to the defined application port of the VM Scale Set.
    2. Add a TLS private key for the VM Scale Set configuration.
    3. Add a custom_data.tpl file with the linked contents from the course repository.
    4. Add an azurerm_linux_virtual_machine_scale_set resource to your configuration using the following values:
      • publisher = "Canonical"
      • offer = "0001-com-ubuntu-server-jammy"
      • sku = "22_04-lts"
      • version = "latest"
    5. Include a reference to the network security group and load balancer backend pool in the network_interface block.
    6. Include the health_probe_id argument referring to the health probe created by the load balancer module.
    7. Add the necessary input variables to the variables.tf file and add the values to the terraform.tfvars file.
    8. Add an output for the public IP address of the load balancer.
    9. Validate and deploy the configuration.
    10. Verify that you can reach the website at the public IP address and port.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight