This example provisions a Linux web server in an Azure Virtual Machine and gives it a public IP address.
-
Create a new stack:
pulumi stack init dev
-
Configure the 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. The
--secretflag ensures your password is encrypted safely.pulumi config set azure-native:location westus # any valid Azure region will do pulumi config set username webmaster pulumi config set password --secret <your-password>
-
Log in to the Azure CLI (you will be prompted to do this during deployment if you forget this step):
az login
-
Install dependencies:
npm install
-
Deploy the stack:
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
Once you're finished experimenting, tear down your stack's resources by destroying and removing it:
pulumi destroy
pulumi stack rm