Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Terraform][AzureRM] terraform plan exits with error retrieving Storage Account (Subscription: "" │ Resource Group Name: "<resource_group_name>" │ Storage Account Name: "<storage_account_name>") #36630

Open
hugo-paredes opened this issue Mar 4, 2025 · 3 comments
Labels
backend/azure bug new new issue not yet triaged

Comments

@hugo-paredes
Copy link

Terraform Version

> terraform version
Terraform v1.11.0
on linux_amd64

Terraform Configuration Files

terraform {
  required_version = "~> 1.9"

  backend "azurerm" {}

  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "~> 4.10"
    }
  }
}

provider "azurerm" {
  subscription_id = var.subscription_id

  features {}
}

Debug Output

│ Error: retrieving Storage Account (Subscription: ""
│ Resource Group Name: "<resource_group_name>"
│ Storage Account Name: "<storage_account_name>"): unexpected status 400 (400 Bad Request) with error: InvalidSubscriptionId: The provided subscription identifier 'resourceGroups' is malformed or invalid.

Expected Behavior

The plan should have been completed successfully

Actual Behavior

│ Error: retrieving Storage Account (Subscription: ""
│ Resource Group Name: "rg-azbnl-we1-nonprod-shared-terraform"
│ Storage Account Name: "satfstatenonprod86167"): unexpected status 400 (400 Bad Request) with error: InvalidSubscriptionId: The provided subscription identifier 'resourceGroups' is malformed or invalid.

Steps to Reproduce

  1. terraform -chdir=src init -backend-config=vars/backend-config-nonprod-we1.tfvars -backend-config=vars/project-backend-variables.tfvars

Additional Context

Prior to updating to Terraform version 1.11.0, I was using version 1.10.5. Running the same steps was working without any problems, as soon as I change to the newer version, I get the error above.
The backend configuration hasn't changed, all fields, including subscription_id and resource_group_name are the same, they're correct and exist.
I see in the release notes reference to .netrc, but I don't think this applies in this case.

References

No response

Generative AI / LLM assisted development?

No response

@hugo-paredes hugo-paredes added bug new new issue not yet triaged labels Mar 4, 2025
@Dome1402
Copy link

Dome1402 commented Mar 4, 2025

I've been facing the same issue here. It took me a while to realize that the problem lies with the new version. Interestingly, this issue doesn't appear in all of my pipelines. Sometimes it works, and sometimes it doesn’t. The strange part is that all of my pipelines use the same YAML files, so they should all behave the same way.

@crw
Copy link
Contributor

crw commented Mar 4, 2025

Have you seen #36596? Curious if this is overlapping.

@black-snow
Copy link

ref. Azure/azure-cli#30953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/azure bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

5 participants