# Bug with Azure provider with Terraform Cloud

**URL:** <https://discuss.hashicorp.com/t/bug-with-azure-provider-with-terraform-cloud/45641>\
**Category:** Azure\
**Tags:** hcp-terraform\
**Created:** [October 14, 2022, 2:36pm UTC](https://discuss.hashicorp.com/t/bug-with-azure-provider-with-terraform-cloud/45641 "2022-10-14T14:36:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![christophe.laurent](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/christophe.laurent/32/23974_2.png) [@christophe.laurent](https://discuss.hashicorp.com/u/christophe.laurent)\
**Post date:** [October 14, 2022, 2:36pm UTC](https://discuss.hashicorp.com/t/bug-with-azure-provider-with-terraform-cloud/45641/1 "2022-10-14T14:36:20Z")

</div>

HI  
All my tests for some time with the azurem provider end in error in the same way.

at first I thought that the error came from the use of landing zones, but on my old tests on other azure subscriptions I still have the same error.

context  
provider.tf:

```auto
terraform {
required_version = ">= 1.3.0"
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = ">= 3.20.0"
    }
  }
}
provider "azurerm" {
  features {}
}

```

main.tf:

```auto
data "azurerm_client_config" "current" {}
data "azurerm_subscription" "current" {}
locals {
  resource_group_name = "rg-terraform-bug"
}

resource "azurerm_resource_group" "terrabug_rg" {
  name = local.resource_group_name
  location = "francecentral"
}

```

i login on azure

```auto
az account get-access-token
{
  "accessToken": "eyJ0eX...WjQ",
  "expiresOn": "2022-10-14 17:51:35.000000",
  "subscription": "-2a1bb8ad4de1",
  "tenant": "6efef",
  "tokenType": "Bearer"
}

az account list -o table
Name CloudName SubscriptionId TenantId State IsDefault
------------------------------------- ----------- ------------------------------------ ------------------------------------ ------- -----------
EPS - Azure Subscription AzureCloud e13ef Enabled True
US0110167-DSO Tools Production AzureCloud c3281 Enabled False
US0110167-DSP Engineering Tools Dev AzureCloud a981 Enabled False

```

my version of az and terraform

```auto
 az --version
azure-cli 2.41.
core 2.41.0
telemetry 1.0.8
Dependencies:
msal 1.20.0b1
azure-mgmt-resource 21.1.0b1

terraform --version
2022-10-14T16:34:01.782+0200 [INFO] Terraform version: 1.3.2
2022-10-14T16:34:01.822+0200 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2022-10-14T16:34:01.823+0200 [DEBUG] using github.com/hashicorp/hcl/v2 v2.14.1
2022-10-14T16:34:01.823+0200 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-10-14T16:34:01.823+0200 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-10-14T16:34:01.823+0200 [DEBUG] using github.com/zclconf/go-cty v1.11.0
2022-10-14T16:34:01.823+0200 [INFO] Go runtime version: go1.19.1
2022-10-14T16:34:01.823+0200 [INFO] CLI args: []string{"C:\\ProgramData\\chocolatey\\lib\\terraform\\tools\\terraform.exe", "--version"}
2022-10-14T16:34:01.828+0200 [DEBUG] Attempting to open CLI config file: C:\Users\SESA615719\AppData\Roaming\terraform.rc
2022-10-14T16:34:01.828+0200 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-10-14T16:34:01.829+0200 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-10-14T16:34:01.829+0200 [DEBUG] ignoring non-existing provider search directory C:\Users\SESA615719\AppData\Roaming\terraform.d\plugins
2022-10-14T16:34:01.832+0200 [DEBUG] ignoring non-existing provider search directory C:\Users\SESA615719\AppData\Roaming\HashiCorp\Terraform\plugins
2022-10-14T16:34:01.832+0200 [INFO] CLI command args: []string{"version", "--version"}
Terraform v1.3.2
on windows_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.27.0

```

the error after a terraform plan:

```auto
2022-10-14T16:27:48.544+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if Service Principal / Client Certificate is applicable for Authentication..: timestamp=2022-10-14T16:27:48.543+0200
2022-10-14T16:27:48.544+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if Multi Tenant Service Principal / Client Secret is applicable for Authentication..: timestamp=2022-10-14T16:27:48.544+0200
2022-10-14T16:27:48.544+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if Service Principal / Client Secret is applicable for Authentication..: timestamp=2022-10-14T16:27:48.544+0200
2022-10-14T16:27:48.544+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if OIDC is applicable for Authentication..: timestamp=2022-10-14T16:27:48.544+0200
2022-10-14T16:27:48.544+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if Managed Service Identity is applicable for Authentication..: timestamp=2022-10-14T16:27:48.544+0200      
2022-10-14T16:27:48.544+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if Obtaining a Multi-tenant token from the Azure CLI is applicable for Authentication..: timestamp=2022-10-14T16:27:48.544+0200
2022-10-14T16:27:48.545+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Testing if Obtaining a token from the Azure CLI is applicable for Authentication..: timestamp=2022-10-14T16:27:48.544+0200
2022-10-14T16:27:48.545+0200 [INFO] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Using Obtaining a token from the Azure CLI for Authentication: timestamp=2022-10-14T16:27:48.544+0200
2022-10-14T16:27:48.584+0200 [ERROR] provider.terraform-provider-azurerm_v3.27.0_x5.exe: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/diag/diagnostics.go:56 diagnostic_summary="building AzureRM Client: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: waiting for the Azure CLI: 
exit status 1." tf_provider_addr=provider tf_rpc=Configure @module=sdk.proto diagnostic_detail= diagnostic_severity=ERROR tf_proto_version=5.2 tf_req_id=9f51219e-a175-d711-69f7-1d834c60d37f timestamp=2022-10-14T16:27:48.584+0200
2022-10-14T16:27:48.585+0200 [ERROR] vertex "provider[\"registry.terraform.io/hashicorp/azurerm\"]" error: building AzureRM Client: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1.
╷
│ Error: building AzureRM Client: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1.
│
│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on provider.tf line 13, in provider "azurerm":
│ 13: provider "azurerm" {
│
╵
2022-10-14T16:27:48.589+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-14T16:27:48.615+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/azurerm/3.27.0/windows_amd64/terraform-provider-azurerm_v3.27.0_x5.exe pid=21620
2022-10-14T16:27:48.615+0200 [DEBUG] provider: plugin exited

```

if you have some workaround  
thanks for your help
