Skip to content

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

@black-snow

Description

@black-snow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions