Azure VM Scale Sets
Basic example of nginx deployed in Azure VM Scale Sets
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set classic-azure-ts-vm-scalesetcd pulumi-examples/classic-azure-ts-vm-scalesetThis 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#
- Node.js
- Download and install the Pulumi CLI
- Connect Pulumi with your Azure account (if your
azCLI is configured, no further changes are required)
Running the App#
-
Create a new stack:
Terminal window pulumi stack init dev -
Configure the app deployment.
Terminal window pulumi config set azure:location westus # any valid Azure region will dopulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>Optionally, configure the username and password for the admin user. Otherwise, they will be auto-generated.
Terminal window pulumi config set adminUser webmasterpulumi config set adminPassword <your-password> --secretNote that
--secretensures your password is encrypted safely. -
Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
Terminal window az login -
Restore NPM dependencies:
Terminal window npm install -
Run
pulumi upto preview and deploy changes:Terminal window pulumi upPreviewing update:...Updating:...Resources:13 createdUpdate duration: 2m19s -
Check the domain name of the PIP:
Terminal window pulumi stack output publicAddressdsuv3vqbgi.westeurope.cloudapp.azure.comcurl http://$(pulumi stack output publicAddress)#nginx welcome screen HTML is returned