Skip to content

bug: subscription_id is still required for az cli #30235

Description

@jaredfholgate

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

latest

AzureRM Provider Version

latest

Affected Resource(s)/Data Source(s)

n/a

Terraform Configuration Files

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

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "this" {
  name     = "rg-test"
  location = "UK South"
}

Debug Output/Panic Output

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

╷
│ Error: building account: unable to configure ResourceManagerAccount: subscription ID could not be determined and was not specified
│ 
│   with provider["registry.terraform.io/hashicorp/azurerm"],
│   on main.tf line 10, in provider "azurerm":
│   10: provider "azurerm" {
│ 
╵

Expected Behaviour

The subscription id from az cli is used

Actual Behaviour

The plan fails

Steps to Reproduce

az login
terraform init
terraform plan

Important Factoids

No response

References

This PR was supposed to fix this, but it does not: #29985

Even when use_cli is explicitly set it still errors. I'm not sure how this fix was tested @jackofallops? Perhaps I am missing something?

This PR does not resolve the reported issue: #28627

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions