1. Packages
  2. Azure Classic
  3. How-to Guides
  4. Azure WebServer with Manual Provisioning

We recommend using Azure Native.

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

Azure WebServer with Manual Provisioning

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 demonstrates using the @pulumi/command package to accomplish post-provisioning configuration steps.

Using these building blocks, one can accomplish much of the same as Terraform provisioners.

Running the Example

First, create a stack, using pulumi stack init.

Now, we need to ensure that our dependencies are installed:

npm install
Copy

You’ll need to log in to the azure cli. You will be prompted to do this during deployment if you forget this step.

az login
Copy

We’ll need to set some config for login credentials, and location information.

pulumi config set azure:location westus
pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
pulumi config set username <your_username>
pulumi config set password --secret <your_desired_password>
Copy

Next, generate an OpenSSH keypair for use with your server - as per the Azure Requirements

ssh-keygen -t rsa -f rsa -m PEM
Copy

This will output two files, rsa and rsa.pub, in the current directory. Be sure not to commit these files!

We then need to configure our stack so that the public key is used by our VM, and the private key used for subsequent SCP and SSH steps to configure our server after it is stood up.

cat rsa.pub | pulumi config set publicKey --
cat rsa | pulumi config set privateKey --secret --
Copy

Notice that we’ve used --secret for privateKey. This ensures the private key is stored as an encrypted Pulumi secret.

From there, you can run pulumi up and all resources will be provisioned and configured.

We recommend using Azure Native.

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