Error building ARM Config: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: Please run 'az login' to setup account

Hi,
We are getting the following error while trying to deploy into Azure portal using Terraform scripts. We are using ‘Plan to apply a Terraform template’ step and then ‘Apply a Terraform template’ as part of this deployment. It’s now failing on the 1st step itself during Plan stage.

But the same steps works fine on another environment and fails only when we select a different new environment. Could you please let me know if we are missing any other settings while trying to deploy into a new environment ? Thanks.

image

16:14:28 Info | “terraform.exe” init -no-color
16:14:28 Info | Initializing modules…
16:14:28 Info | - static_site_react in modules\static_site
16:14:28 Info | - web_app_complaintsapi in modules\web_app_for_containers
16:14:28 Info | - web_app_monitoringapi in modules\web_app
16:14:28 Info | - web_app_sitemanagementapi in modules\web_app
16:14:48 Info | Initializing the backend…
16:14:48 Error | Error: Error building ARM Config: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: Please run ‘az login’ to setup account.

Hi @alram,

Thanks for reaching out on our help forum and welcome to the community!

I’m sorry that you’ve run into an issue with your Terraform deployment. It looks like you’ve run into a known bug with the Azure Terraform provider.

There is no official workaround but a user made a comment that you can try to see if you’re able to get past that error.

Let us know if you have any other questions.

Best,
Brent