-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Fix #8840: Tenant domain name is not accepted by Key Vault #10418
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for doing the conversion at 'az login' level if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the domain resolution logic to az login. @yugangw-msft, please kindly review. Thanks!
az login --service-principal -u {} -p {} -t {}.onmicrosoft.com shows warning 'Resolve tenant domain name %s to GUID %s'.
az keyvault create --name {} -g {} should be good.
| uuid.UUID(guid) | ||
| return True | ||
| except ValueError: | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can return False here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! All _is_guids are fixed.
|
This is a user facing change, please add a releasing note |
rajarshi-singh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for taking care of this. :)
| if not _is_guid(namespace.tenant): | ||
| import requests | ||
| active_directory_endpoint = cmd.cli_ctx.cloud.endpoints.active_directory | ||
| url = '{}/{}/.well-known/openid-configuration'.format(active_directory_endpoint, namespace.tenant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1.0 endpoint is now deprecated, so we need to migrate to v2.0:
https://login.microsoftonline.com/azuresdkteam.onmicrosoft.com/.well-known/openid-configuration ->
https://login.microsoftonline.com/azuresdkteam.onmicrosoft.com/v2.0/.well-known/openid-configuration
Official documentation on /.well-known/openid-configuration: https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#find-your-apps-openid-configuration-document-uri
Fix #8840: Convert tenant domain name to GUID if it is not.