Azure / Azure/azure-cli

Terraform plan is not working for azurerm

Open
#31,772 3 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

for some reason, right after I changed to a "Pay as you go" subscription in azure, I can't do terraform plan, I've tried everything, and I do mean, EVERYTHING, not even the AI can tell what the issue is,

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


│ Error: building account: could not acquire access token to parse claims: running Azure CLI: exit status 1: ERROR: Account has previously been signed out of this application.. Status: Response_Status.Status_AccountUnusable, Error code: 0, Tag: 540940121
│ Please explicitly log in with:
│ az login --scope https://graph.microsoft.com/.default

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

I've already logged in a million times, I've already used the tennant ID, So I don't know what's going on, I don't know if it's because of my subscription, because of my local config, I don't know, I alrady did a clean project and that worked but now I brought the main.tf file to a clean folder...and it doesn't work

### Related command

terraform plan

### Errors

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


│ Error: building account: could not acquire access token to parse claims: running Azure CLI: exit status 1: ERROR: Account has previously been signed out of this application.. Status: Response_Status.Status_AccountUnusable, Error code: 0, Tag: 540940121
│ Please explicitly log in with:
│ az login --scope https://graph.microsoft.com/.default

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

### Issue script & Debug output

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.0.0"
}
}
}

provider "azurerm"{
features {}
}

resource "azurerm_resource_group" "main" {
name = "spotifymoods_rg"
location = "East US"
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.0.0"
}
}
}

provider "azurerm"{
features {}
}

resource "azurerm_resource_group" "main" {
name = "spotifymoods_rg"
location = "East US"
}

module "SpotifyMoodsApp" {
source = "./modules/staticWebApp"

app_name = "SpotifyMoods"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location

}

### Expected behavior

to make a plan

### Environment Summary

azure-cli in CMD or Powershell

### 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.