Hi
I’m new to Terraform. Using Terraform Cloud I try to create a resource group in Azure. I have a very simple main.tf file in github containing this:
provider “azurerm” {
subscription_id = “ID-removed”
tenant_id = “Tenant-ID-removed”
}
resource “azurerm_resource_group” “temp01” {
name = “someNameNotFoundAlready”
location = “East US”
}
In Terraform Cloud I defined environment variabels for
client_id
client_secret
In Azure I’ve setup RBAC on the subscription using:
PS Azure:> az ad sp create-for-rbac --role=“Contributor” --scopes="/subscriptions/Subscription-ID-removed"
The generated appId is then configured in Terraform Cloud as client_id and password as client_secret.
When I queue the plan in Terraform Cloud it fails with this message:
Error: Error building AzureRM Client: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with az login
.
on main.tf line 1, in provider “azurerm”:
1: provider “azurerm” {
Isn’t it possible to authenticate to Azure this way from Terraform Cloud? It seems like the Azure CLI is not available. I can connect from Azure cloud console locally, but that is not what I want. I’ve read the relevant documentation multiple times, but it seems like it mostly addresses the local scenario.
Thanks in advance!
Henrik