By following this workshop, you will learn the basics of Pulumi and its Azure provider by deploying real cloud resources. Therefore, several tools are required to go forward.
Azure Subscription
You will need an active Azure subscription to deploy the application components. The total cost of all resources you will create should be very close to $0. You can use your developer subscription, or create a free Azure subscription here.
Be sure to clean up the resources after you complete the workshop, as described in the last step.
Azure CLI
We will use the command-line interface (CLI) tool to log in to an Azure subscription and run some queries. You can install the CLI tool, as described here.
The tool is cross-platform: it should work on Windows, macOS, or Linux (including WSL).
After you complete the installation, open a command prompt and type az. You should see the welcome message:
$az/\/\ ___________//\ \ |_/|||\'__/ _\ / ____ \ / /| |_| | | | __/ /_/ \_\/___|\__,_|_| \___|Welcome to the cool new Azure CLI!Use `az --version` to display the current version.
Now, login to your Azure account by typing az login and providing your credentials in the browser window. When this is done, type az account show:
Pulumi provides a CLI tool that drives cloud deployments from the machine where it runs. It is a cross-platform executable that has to be accessible on the system’s PATH. You can also follow this guide to install the Pulumi CLI.
Run pulumi version, and you should get a response back:
Node.js and TypeScript compiler
You will write Pulumi programs in TypeScript. They will be executed by Node.js behind the scenes.
It’s quite likely you already have Node installed. If not, navigate to Download Page and install Node.js with npm.
If you have npm installed, you can install TypeScript globally on your computer with npm install -g typescript.
Text editor
Any text editor will do, but I recommend one with TypeScript syntax highlighting. The most common choice is Visual Studio Code.
// Some code
$ az account show
{
"environmentName": "AzureCloud",
"id": "12345678-9abc-def0-1234-56789abcdef0",
"isDefault": true,
"name": "My Subscription Name",
"state": "Enabled",
"tenantId": "eeeeeee-eeee-eeee-eeee-eeeeeeeeeeee",
"user": {
"name": "name@example.com",
"type": "user"
}
}
# List available subscriptions on the logged in account
az account list
# List available subscriptions for the tenant
az account subscription list
# Set a subscription to be the current active subscription
# Subscription ID is displayed by the previous command
az account set --subscription 0ad021f2-9dde-4cb1-8aa4-d71018aaeec8