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

{RDBMS} Use ServicePrincipalCredential with environment credential #22124

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented Apr 20, 2022

Description

#22009 relies on the latest msal-extensions 1.0.0, but azure-identity will release a new version (Azure/azure-sdk-for-python#24083) as early as 2020-04-22. This will miss our 2022-04-20 code freeze deadline and 2022-04-22 release schedule for Apr 2022 sprint.

rdbms is the only module using azure-identity. #4908 first uses env vars to create azure.common.credentials.ServicePrincipalCredentials and passes the credential to client constructor. #17191 migrated to using azure.identity.ClientSecretCredential.

Since Azure CLI has migrated to MSAL (#19853), rdbms can now use ServicePrincipalCredential provided by azure.cli.core with environment credential.

We will fully support environment credential in the future (#10241).

Testing Guide

Set env vars:

AZURE_CLIENT_ID=...
AZURE_TENANT_ID=54826b22-38d6-4fb2-bad9-b7b93a3e9c5a
AZURE_CLIENT_SECRET=...
AZURE_CLI_RDBMS_RM_URI=https://management.azure.com/
AZURE_CLI_RDBMS_SUB_ID=0b1f6471-1bf0-4dda-aec3-cb9272f09590

Run

az mysql server list

@ghost ghost requested a review from yonzhan April 20, 2022 05:38
@ghost ghost added the Auto-Assign Auto assign by bot label Apr 20, 2022
@ghost ghost assigned evelyn-ys Apr 20, 2022
@ghost ghost added this to the Apr 2022 (2022-04-26) milestone Apr 20, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 20, 2022

RDBMS


authority, _ = _get_authority_url(
# Override authority host if defined as env var
getenv(AZURE_AUTHORITY_HOST) or 'https://login.microsoftonline.com',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants