-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Misc.} Remove more direct calls to msrestazure
#31603
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
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
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.
Pull Request Overview
This PR removes remaining direct calls to msrestazure to consolidate usage on the newer azure.mgmt.core.tools and drops an outdated test for MSI authentication.
- Updated resource ID validation import to use azure.mgmt.core.tools.
- Removed legacy test for managed identity user-assigned object ID authentication.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acs/_validators.py | Updated import for resource ID validation |
| src/azure-cli-core/azure/cli/core/tests/test_profile.py | Removed legacy MSI authentication test |
Comments suppressed due to low confidence (2)
src/azure-cli-core/azure/cli/core/tests/test_profile.py:501
- Ensure that the removal of tests for MSIAuthenticationWrapper does not leave the user-assigned managed identity scenario uncovered; verify alternative tests are in place if applicable.
@mock.patch('azure.cli.core.auth.adal_authentication.MSIAuthenticationWrapper', autospec=True)
src/azure-cli/azure/cli/command_modules/acs/_validators.py:863
- Confirm that the switch from msrestazure to azure.mgmt.core.tools is fully supported in all deployment environments.
from azure.mgmt.core.tools import is_valid_resource_id
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
| if container_registry_resource_id is None or container_registry_resource_id == '': | ||
| return | ||
| from msrestazure.tools import is_valid_resource_id | ||
| from azure.mgmt.core.tools import is_valid_resource_id |
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.
| def test_login_with_mi_user_assigned_object_id(self, create_subscription_client_mock, | ||
| mock_msi_auth): |
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.
This test was overlooked in #31577.
Testing Guide
Remove more direct calls to
msrestazurethat are not covered bymsrestazure#29856msrestazuremanaged identity authentication #31577