Having an issue running any Terraform through Azure CLI Authentication local. I can use Azure CLI to login, set default subscription, and even create a resource group using the CLI syntax fine. When I try to so the same through terraform, I keep getting the same error below:
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: unable to build authorizer for Resource Manager API: could not configure AzureCli Authorizer: could not parse Azure CLI version: unmarshaling the output of Azure CLI: invalid character ‘C’ looking for beginning of value
│
│ with provider[“Terraform Registry”],
│ on main2.tf line 10, in provider “azurerm”:
│ 10: provider “azurerm” {
Here is the contents of the main2.tf file:
terraform {
required_providers {
azurerm = {
source = “hashicorp/azurerm”
version = “>= 3.82.0”
}
}
}provider “azurerm” {
features{}
}resource “azurerm_resource_group” “rg” {
name = “matttest”
location = “eastus”
}
Very odd. I’ve uninstalled and reinstalled both Terraform and Azure CLI multiple times.
Thoughts?