Part 4: Terraform with Azure – How to install Azure Terraform Plugin in Visual Studio Code

Reading Time: 2 minutes

My journey preparing to get started with learning Terraform to allow me to deploy workloads into Microsoft Azure continues. If you missed the previous posts, please visit the links below.

Part 1: Terraform with Azure – How to install Terraform
Part 2: Terraform with Azure – How to install Azure cli
Part 3: Terraform with Azure – How to Install Visual Studio Code

In this blog post I will go through the process of installing the Azure Terraform plugin within Visual Studio Code.

The VSCode Azure Terraform extension is designed to increase developer productivity authoring, testing and using Terraform with Azure. The extension provides terraform command support, resource graph visualization and CloudShell integration inside VSCode. For more information visit the following link, Azure Terraform Extension

  1. Launch Visual Studio Code
  2. Click the extensions icon as shown in the screenshot below

3. Type Terraform in the search box and take a look at the various plugins available.

For now, I’ll only be installing extensions Azure Terraform and Syntax highlighting and autocompleting . You can also use keys Ctrl Shift and X to access the extensions area within Visual Studio Code

4. Allow the installs to complete

5. To verify the installations, type @installed in the search box as shown below.

Incase you’re wondering why the Azure Account extension was installed. When installing the Azure Terraform extension, Visual Studio Code will automatically install the Azure Account extension. Azure Account is a dependency file for the Azure Terraform extension, which it uses to perform Azure subscription authentications and Azure related code extensions.

Stay tuned for part 5 where I will go through the process of installing Git on my Windows device and enable in Visual Studio Code. I will also be setting up a GitHub account.

Git vs GitHub

– Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git will allow you create a local repository on your device and manage versions of your files. It runs locally but if required you could clone your local version to the GitHub repository. More info at Git

– GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. More info at GitHub

Part 3: Terraform with Azure – How to Install Visual Studio Code

Reading Time: 2 minutes

My journey preparing to get started with learning Terraform to allow me to deploy workloads into Microsoft Azure continues. If you missed the previous posts, please visit the links below.

Part 1: Terraform with Azure – How to install Terraform
Part 2: Terraform with Azure – How to install Azure cli

Moving to Part 3, in this post I will go through the process of installing Visual Studio Code. Let’s get started.

What is Visual Studio Code?
Visual Studio Code combines the simplicity of a source code editor with powerful developer tooling, like IntelliSense code completion and debugging. First and foremost, it is an editor that gets out of your way. The delightfully frictionless edit-build-debug cycle means less time fiddling with your environment, and more time executing on your ideas. For more information on Visual Studio Code click the following link Microsoft.

  1. Visit https://code.visualstudio.com/download
  2. I’ll be downloading the Windows version (System Installer 64-bit) as shown below. The download was approx 70MB in size at the time of writing this post.

3. Run the installation

4. Accept the agreement when ready to do so and click next

5. Click next

6. Click next

7. I select ‘Create a desktop icon’ and click next

8. Click Install

9. Click finish

In part 4, I go through the process of installing the Azure Terraform plugin within Visual Studio Code, click the following link to continue on my journey, Part 4: Terraform with Azure – How to install Azure Terraform Plugin in Visual Code

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).

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