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

Support user-based authentication in live tests #33994

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

mccoyp
Copy link
Member

@mccoyp mccoyp commented Jan 24, 2024

Description

Adds support for Azure PowerShell and CLI authentication, building on new support for user authentication with live test resources -- see Azure/azure-sdk-tools#7580.

Since most users deploy test resources with PowerShell via New-TestResources.ps1, I gave AZURE_TEST_USE_PWSH_AUTH preference over AZURE_TEST_USE_CLI_AUTH when both are set to "true".

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@mccoyp mccoyp added the EngSys This issue is impacting the engineering system. label Jan 24, 2024
@mccoyp mccoyp requested review from lmazuel and scbedd January 24, 2024 22:36
Copy link
Member

@lmazuel lmazuel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@scbedd scbedd left a comment

Choose a reason for hiding this comment

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

Is importing the AzureCLICredential literally all you need to do here? That's pretty legit.

@mccoyp
Copy link
Member Author

mccoyp commented Jan 25, 2024

Is importing the AzureCLICredential literally all you need to do here? That's pretty legit.

Yep! As long as users are using the get_credential method on the test class -- which is the recommended flow -- they'll pick up the change. Fortunately the transition to user-based auth seems a lot simpler than we might have expected.

@mccoyp mccoyp enabled auto-merge (squash) January 25, 2024 00:25
@mccoyp mccoyp disabled auto-merge January 25, 2024 00:51
@mccoyp mccoyp merged commit 8262041 into Azure:main Jan 25, 2024
16 checks passed
@mccoyp mccoyp deleted the test-user-auth branch January 25, 2024 01:06
sofiar-msft pushed a commit to sofiar-msft/azure-sdk-for-python that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EngSys This issue is impacting the engineering system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants