These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi
Web Server Using Azure Virtual Machine
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi
This example provisions a Linux web server in an Azure Virtual Machine and gives it a public IP address.
Prerequisites
- Node.js
- Download and install the Pulumi CLI (you will also need to configure Pulumi for a supported state backend; by default it will use Pulumi Cloud)
- Connect Pulumi with your Azure account (if your
azCLI is configured, no further changes are required)
Running the App
These instructions assume you are running all commands in the same folder where the code resides (unless otherwise indicated).
Create a new stack:
$ pulumi stack init devConfigure 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-native:location westus # any valid Azure region will do $ pulumi config set username webmaster $ pulumi config set password --secret <your-password>Note 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):
$ az loginRestore NPM dependencies:
$ npm installRun
pulumi upto preview and deploy changes:$ pulumi up Previewing changes: ... Performing changes: ... info: 7 changes performed: + 7 resources created Update duration: 2m38sCheck the IP address:
$ pulumi stack output ipAddress 40.112.181.239
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi