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 - unexpected status 400 (400 Bad Request) with error: InvalidSubscriptionId: The provided subscription identifier 'resourceGroups' is malformed or invalid #30953

Closed
black-snow opened this issue Mar 5, 2025 · 5 comments
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@black-snow
Copy link

black-snow commented Mar 5, 2025

Describe the bug

I'm not sure this is related to az cli but since I haven't changed anything else it's my prime suspect.

I can no longer run anything in my IaC repos where azurerm is used. It errors out with:

unexpected status 400 (400 Bad Request) with error: InvalidSubscriptionId: The provided subscription identifier 'resourceGroups' is malformed or invalid

Even a terraform providers will error out.

Related command

terraform plan

Errors

unexpected status 400 (400 Bad Request) with error: InvalidSubscriptionId: The provided subscription identifier 'resourceGroups' is malformed or invalid

Issue script & Debug output

2025-03-05T10:20:33.852+0100 [DEBUG] az-cli invocation: az version -o=json
2025-03-05T10:20:34.557+0100 [DEBUG] az-cli invocation: az account show -o=json
2025-03-05T10:20:34.995+0100 [DEBUG] az-cli invocation: az account get-access-token --scope https://management.azure.com/.default --tenant xxx -o=json
2025-03-05T10:20:35.414+0100 [DEBUG] GET https://management.azure.com/subscriptions//resourceGroups/tfstate/providers/Microsoft.Storage/storageAccounts/xxx?api-version=2023-01-01

Expected behavior

it should ... work

Environment Summary

azure-cli 2.70.0

core 2.70.0
telemetry 1.1.0

Extensions:
storage-preview 1.0.0b1

Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/bin/python'
Config directory '/Users/xxx/.azure'
Extensions directory '/Users/xxx/.azure/cliextensions'

Python (Darwin) 3.12.9 (main, Feb 4 2025, 14:38:38) [Clang 16.0.0 (clang-1600.0.26.6)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

tf 1.11.0

@black-snow black-snow added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 5, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 5, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group labels Mar 5, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 5, 2025
@yonzhan yonzhan added Service Attention This issue is responsible by Azure service team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Azure CLI Team The command of the issue is owned by Azure CLI team labels Mar 5, 2025
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @josephkwchan, @jennyhunter-msft.

@mateuszmikrut
Copy link

mateuszmikrut commented Mar 5, 2025

I face the same issue after upgarde today:

Terraform version

Terraform v1.11.0
on darwin_arm64
+ provider registry.terraform.io/azure/azapi v2.2.0
+ provider registry.terraform.io/hashicorp/azurerm v3.92.0
+ provider registry.terraform.io/hashicorp/local v2.5.2
+ provider registry.terraform.io/hashicorp/random v3.7.1
+ provider registry.terraform.io/hashicorp/tls v4.0.6

azure-cli version

{
  "azure-cli": "2.70.0",
  "azure-cli-core": "2.70.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {}
}

Installed via brew

==> azure-cli: stable 2.70.0 (bottled), HEAD
Microsoft Azure CLI 2.0
https://docs.microsoft.com/cli/azure/overview
Installed
/opt/homebrew/Cellar/azure-cli/2.70.0 (24,174 files, 569.2MB) *
  Poured from bottle using the formulae.brew.sh API on 2025-03-05 at 13:48:40
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/azure-cli.rb
License: MIT
==> Dependencies
Build: pkgconf ✘, rust ✘
Required: libsodium ✔, libyaml ✔, openssl@3 ✔, [email protected] ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 36,900 (30 days), 95,891 (90 days), 354,475 (365 days)
install-on-request: 36,857 (30 days), 95,791 (90 days), 354,080 (365 days)
build-error: 17 (30 days)

@mateuszmikrut
Copy link

This is not azure-cli issue - it's a terraform.

All works as expected on 1.10.5

@black-snow
Copy link
Author

Leading issue seems to be hashicorp/terraform#36596 - closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants