How to hook Terraform into Azure

You can hook Terraform into Azure with the following requirements:

  1. client_id, Azure counterpart is Application ID within AAD directory application.
  2. client_secret, Password Keys within AAD directory application.
  3. tenant_id, AAD Directory ID.
  4. subscription_id, Azure Subscription ID.

Once we gather above details, we can then proceed to write our Provider function within our Terraform script.

 

Below is an example; replacing variable values with your own tenant.

provider "azurerm" {
version="1.27"
client_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
client_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
tenant_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
subscription_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}