This example provisions a Linux web server in an Azure Virtual Machine and gives it a public IP address.
- Node.js
- Download and install the Pulumi CLI
- Connect Pulumi with your Azure account (if your
az
CLI is configured, no further changes are required)
After cloning this repo, from this working directory, run these commands:
-
Create a new stack:
$ pulumi stack init dev
-
Configure the app deployment. The username and password here will be used to configure the Virtual Machine. The password must adhere to the Azure restrictions on VM passwords.
$ pulumi config set azure:location westus # any valid Azure region will do $ pulumi config set username webmaster $ pulumi config set password <your-password> --secret
Note that
--secret
ensures your password is encrypted safely. -
Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
$ az login
-
Restore NPM dependencies:
$ npm install
-
Run
pulumi up
to preview and deploy changes:$ pulumi up Previewing changes: ... Performing changes: ... info: 7 changes performed: + 7 resources created Update duration: 2m38s
-
Check the IP address:
$ pulumi stack output ipAddress 40.112.181.239