Prerequisites
To follow this tutorial, you need:
- An Azure account
- The Azure CLI program
- The Terraform CLI program
Optionally, you may want to save your work in a GitHub repository, as well.
This page describes how to set up and install the necessary applications.
Create a free Azure account
To create your free Azure account:
- Go to azure.microsoft.com.
-
Select Try Azure for free.
Set up the Azure CLI
-
Download the Azure CLI for your operating system:
-
In your terminal, run the following command:
az login
A browser window opens at
https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
.Select your Microsoft account to log in.
If a window does not open, cancel the command (Ctrl + C) and run the following command instead:
az login --use-device-code
Then follow the directions in the terminal to log in.
-
From the table in your terminal, select your subscription.
If you have only one subscription, press Enter.
If you have more than one subscription, enter the number in the left-most column of your desired subscription's row and then press Enter.
If the terminal shows your tenant and subscription ID, you've successfully logged in to the Azure CLI. You may seem some announcements or warnings, as well.

Install the Terraform CLI
- Go to Install Terraform.
-
Download the Terraform package for your operating system:
-
To confirm the installation, run the following command:
terraform -version
The command returns the version of the downloaded Terraform package.
Install the Terraform VS Code extensions
-
Open VS Code and select the Extensions icon.
- Search for Terraform.
- From the search results, find the extension published by HashiCorp.
-
Select Install.
A new window opens in VS Code.
You’ve successfully installed the Terraform extension