In Chapter 1, Setting Up the Terraform Environment, of this book, we studied the steps involved in installing Terraform on a local machine.
In the Azure Shell console, known as Azure Cloud Shell, Microsoft has integrated Terraform in the list of tools that are installed by default.
In this recipe, we will see how to write a Terraform configuration and use Terraform in Azure Cloud Shell.
Getting ready
The prerequisite for this recipe is to have an Azure subscription and to be connected to this subscription via the Azure portal, which is accessible here: https://portal.azure.com/
In addition, you need to associate your Cloud Shell with an existing Azure Storage Account or create a new one, as explained in the following documentation: https://docs.microsoft.com/en-us/azure/cloud-shell/persisting-shell-storage.
How to do it…
In order to use Terraform in Azure Cloud Shell, perform...