1. Packages
  2. Azure Classic
  3. How-to Guides
  4. Azure VM Scale Sets

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Azure VM Scale Sets

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

View Code Deploy this example with Pulumi

This example provisions a Scale Set of Linux web servers with nginx deployed, configured the auto-scaling based on CPU load, puts a Load Balancer in front of them, and gives it a public IP address.

Prerequisites

  1. Install Pulumi
  2. Configure Pulumi for Azure
  3. Configure Pulumi for Python

Running the App

  1. Create a new stack:

    pulumi stack init dev
    
    Copy
  2. Configure the app deployment.

    pulumi config set azure:location westus    # any valid Azure region will do
    pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
    
    Copy

    Optionally, configure the username and password for the admin user. Otherwise, they will be auto-generated.

    pulumi config set adminUser webmaster
    pulumi config set adminPassword <your-password> --secret
    
    Copy

    Note that --secret ensures your password is encrypted safely.

  3. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):

    az login
    
    Copy
  4. Run pulumi up to preview and deploy changes:

    $ pulumi up
    Previewing update:
    ...
    
    Updating:
    ...
    Resources:
        13 created
    Update duration: 2m19s
    
    Copy
  5. Check the domain name of the PIP:

    $ pulumi stack output publicAddress
    dsuv3vqbgi.westeurope.cloudapp.azure.com
    $ curl http://$(pulumi stack output publicAddress)
    #nginx welcome screen HTML is returned
    
    Copy

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi