Part 2: Terraform with Azure – How to install Azure CLI

Reading Time: 2 minutes

Following on from a previous post where I installed and configured Terraform, see How to Install Terraform, in this post I will continue my journey learning Terraform by going through the process of installing a useful tool known Azure command-line interface (Azure CLI).

The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation. It’s a useful tool to have installed on my machine so let’s get started.

  1. Visit the Azure CLI web page Download Azure CLI
  2. Click Install – Windows

3. Click Current release of Azure CLI. The download was approx 45MB at the time of writing this blog post

4. Run the installer

5. Accept the licence agreement when ready to do so and click install

The install can take up to 10 minutes to complete

6. Launch Powershell and type az login and press enter

7. If successful, you’ll be presented with the Microsoft login screen

In part 3, I go through the process of installing Visual Studio Code, click the following link to continue on my journey, Part 3: Terraform with Azure – How to Install Visual Studio Code

Part 1: Terraform with Azure – How to install Terraform

Reading Time: 3 minutes

Welcome to part 1 of Terraform on Azure. My journey on learning Terraform to allow me to automate workloads within Microsoft Azure. If you’ve not already done so, please subscribe to stay up to date on the latest blog posts.

Let’s get started 🙂

What is Terraform?
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. Terraform is a tool and also a language. That language is called Hashicorp Config language (HCL). Terraform is written in Go (also known as GoLang) is an open-source programming language designed by Google.

Configuration files describe to Terraform the components needed to run a single application or your entire datacenter. Terraform generates an execution plan describing what it will do to reach the desired state, and then executes it to build the described infrastructure. As the configuration changes, Terraform is able to determine what changed and create incremental execution plans which can be applied.

Terraform can be used to automate the provisioning of cloud infrastructure. Terraform will allow you to write and deploy your cloud infrastructure setup in code. If you have experience with Microsoft Azure or other cloud providers such as AWS, Google Cloud etc, you will know that deploying infrastructure using the Microsoft Azure Portal is a manual and repetitive task which an be time consuming. Terraform helps automate your builds by using Infrastructure as Code, rather than manually going through the steps in the portal.

How to install Terraform?

1) Visit https://www.terraform.io/
2) Click download

3) Select your operating system. I’ll be selecting Windows for this demo

4) Download Terraform 32 or 64 bit depending on your requirements

5) Extract the file

6) Next add the .exe to the path within Windows – click the start menu, search and click view advanced system settings

7) Click Environmental Variable

8) Click path and click edit

9) Click new

10) Type the path to the Terraform folder you created

11) Click OK, OK and OK

12) To check the change you implemented works, launch powershell or command prompt

13) Type terraform and press enter.

You should receive a similar output to the one below

In part 2, I go through the process of installing a useful tool known as Azure CLI, click the following link to continue on my journey, Part 2: Terraform with Azure – how to install Azure CLI