Azure / Azure/azure-cli

Unable to login into the Azure portal through terraform

Open
#31,190 2 comments 0 reactions 1 assignee Claimed by @jiasli View on GitHub
Account act-identity-squad Auto-Assign bug customer-reported Possible-Solution Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

I have been using the backend block by providing the "access_key" details of the storage account, but it's still prompting for az login. Below is the error message I am currently encountering:

### Related command

terraform plan

### Errors

Planning failed. Terraform encountered an error while generating this plan.


│ Error: unable to build authorizer for Resource Manager API: could not configure AzureCli Authorizer: tenant ID was not specified and the default tenant ID could not be determined: obtaining tenant ID: obtaining account details: running Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.

│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on backend.tf line 21, in provider "azurerm":
│ 21: provider "azurerm" {

### Issue script & Debug output

terraform plan
Acquiring state lock. This may take a few moments...

Planning failed. Terraform encountered an error while generating this plan.


│ Error: unable to build authorizer for Resource Manager API: could not configure AzureCli Authorizer: tenant ID was not specified and the default tenant ID could not be determined: obtaining tenant ID: obtaining account details: running Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.

│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on backend.tf line 21, in provider "azurerm":
│ 21: provider "azurerm" {

### Expected behavior

it should run

### Environment Summary

Terraform v1.11.2
on windows_amd64
+ provider registry.terraform.io/hashicorp/azurerm v4.25.0

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.