The Wayback Machine - https://web.archive.org/web/20211002013825/https://github.com/hashicorp/terraform/issues/29425
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

Remote state listing keys requires az default subscription set #29425

Open
drdamour opened this issue Jan 6, 2020 · 5 comments
Open

Remote state listing keys requires az default subscription set #29425

drdamour opened this issue Jan 6, 2020 · 5 comments

Comments

@drdamour
Copy link

@drdamour drdamour commented Jan 6, 2020

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 "+1" or "me too" comments, 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

Terraform (and AzureRM Provider) Version

> terraform -v
Terraform v0.12.18
+ provider.azuread v0.7.0
+ provider.azurerm v1.39.0
+ provider.null v2.1.2

Affected Resource(s)

azurerm provider

Terraform Configuration Files

  backend "azurerm" {
    resource_group_name   = "grpX"
    storage_account_name  = "accX"
    container_name        = "cntX"
    key                   = "keyX"
  }

  provider "azurerm" {

    subscription_id = "<myid>"
  }

Debug Output

N/A

Panic Output

N/A

Expected Behavior

TF should attempt to retrieve keys for the subscription identified in the azurerm provider configuration explicitly.

Actual Behavior

TF attempts to retrieve keys for the default subscription of the azure cli

Steps to Reproduce

  1. have an account with access to 2 subscriptions a1 and b1
  2. have tf that has b1 as the subscription with the remote state
  3. login with the az cli
  4. az account set -s a1
  5. terraform init

you'll get an error about not being able to retrieve keys. running the following works around the issue.

  1. az account set -s b1
  2. terraform init

Important Factoids

References

@favoretti
Copy link

@favoretti favoretti commented Aug 19, 2021

Since this issue has been reported a long time ago and relates to the version of provider we no longer support - I'm going to close it. Please open a new updated bug report on current versions of terraform and provider if this is still relevant. Thank you.

@favoretti favoretti closed this Aug 19, 2021
@drdamour
Copy link
Author

@drdamour drdamour commented Aug 19, 2021

@favoretti this is still an issue with the latest version can we please just reopen?

@favoretti
Copy link

@favoretti favoretti commented Aug 19, 2021

@drdamour certainly. Apologies for closing too early.

@favoretti favoretti reopened this Aug 19, 2021
@tombuildsstuff tombuildsstuff transferred this issue from hashicorp/terraform-provider-azurerm Aug 20, 2021
@tombuildsstuff
Copy link
Member

@tombuildsstuff tombuildsstuff commented Aug 20, 2021

Transferring this to Core since Backends are located within the Core repository - so this documentation issue needs to be fixed here

@hakanbakacak
Copy link

@hakanbakacak hakanbakacak commented Sep 19, 2021

Hi, I want to contribute to this but even though I read the docs, I couldn't fully understand the situation. I wonder if we should create a new field in this document and give information about the cli? @tombuildsstuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants