-
Notifications
You must be signed in to change notification settings - Fork 49
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
Support subscription ids for cli authorizer #780
Support subscription ids for cli authorizer #780
Conversation
@tony-brewerio Thanks for looking at this. I'll take a look separately at hashicorp/terraform-provider-azurerm#23068, but unfortunately this will not help to resolve that issue. When you specify Accordingly, whilst the fix for the underlying issue is likely to be needed in the SDK, as there is no real need to support translating a subscription ID to the associated tenant ID, I'll close this PR and we probably won't look to merge this as-is. |
@manicminer The issue this PR tries to solve is not related to tenants at all. Maybe I have not explained it in detail in the provider issue, but here's my use case. When you pass subscription id to Which is why I am using azurerm 3.43 and cannot upgrade - since 3.44 broke subscription id handling for azurerm provider. Given what you have said, I imagine that if all my accounts were in different tenants, then I could configure explicit tenant id for providers and it would work, but alas. My idea was to pass subscription id from azurerm to cli authenticator, which currently does not happen, and that would fix it for me. |
@manicminer Is is possible to revive the PR? I have reviewed the code a bit, and it looks like a safer option would be to verify that tenant id matches the one that's configured for the subscription. I am open to any suggestions at how to rework the PR as well, perhaps with separating out a different authenticator for this use case? |
Another vote to revive it from here. This is a real problem for advanced use cases. @manicminer Was it actually tested to work or not? |
I am looking into this, please see my comment in AzureRM issue #23068 for more info, thanks! |
Superseded by #1008 |
This adds support for specifying an explicit subscription id for
get-access-token
call, which currently always obtains a token for the default subscription.Required to fix subscription id regression in azurerm terraform provider, please see the link below.
hashicorp/terraform-provider-azurerm#23068
I am not sure if this is a good implementation per se, because of how it interacts with tenants.
Azure CLI requires you to specify either a subscription id or a tenant id, but not both, so I've added two checks there.
Should this perhaps be refactored into a separate Authorizer?
One that would not accept tenant ids in its configuration and will always return an error or an empty result when asked for auxiliary ids?