title | description | keywords | ms.topic | ms.date | ms.custom | adobe-target |
---|---|---|---|---|---|---|
Install Terraform on Windows with Bash |
Learn how to install Terraform on Windows with Bash |
terraform azure cli devops install configure windows interactive login rbac service principal automated script |
how-to |
08/07/2021 |
devx-track-terraform, mode-api, devx-track-azurecli |
true |
[!INCLUDE Terraform abstract]
This article presents you with the options to authenticate to Azure for use with Terraform.
In this article, you learn how to:
[!div class="checklist"]
- Install the Git Bash terminal emulator
- Install Azure CLI
- Install Terraform
- Configure your environment to run Terraform on Windows
- Understand common Terraform and Azure authentication scenarios
- Authenticate via a Microsoft account from Cloud Shell (using Bash or PowerShell)
- Authenticate via a Microsoft account from Windows (using Bash or PowerShell)
- Create a service principal using the Azure CLI
- Create a service principal using Azure PowerShell
- Specify service principal credentials in environment variables
- Specify service principal credentials in a Terraform provider block
[!INCLUDE open-source-devops-prereqs-azure-subscription.md]
There are many options on Windows to run bash commands, including Git Bash and Windows Terminal. This article has been tested using Git Bash. Download and install Git Bash.
Install the Azure CLI. This article was tested using Azure CLI version 2.26.1.
[!INCLUDE install-terraform-on-windows.md]
[!INCLUDE authenticate-to-azure.md]
Troubleshoot common problems when using Terraform on Azure
[!div class="nextstepaction"] Create Azure resource group