-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
- Package Name: azure-cli-core
- Package Version: 2.12.1
- Operating System:
- Python Version: 3.8
Describe the bug
I’m working on updating the Python Developer Center's example pages for track 2 management libraries, starting with https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-example-resource-group (and its peers in the TOC).
These examples use azure.common.client_factory.get_client_from_cli_profile because these are provisioning scripts that are equivalent to what one might do with the Azure CLI. Thus it’s appropriate to use the CLI profile login rather than using a method like DefaultAzureCredential (which apparently doesn't use CLI credentials etc.), because the latter requires that the service principal in question has been assigned the appropriate role permissions. Although it's possible to just assign the SP some very broad role, I'd rather not add that (potentially dangerous) complexity to the examples. By using the CLI profile, it's clear that you're inheriting that profile's permissions.
Unfortunately, it appears that the azure-cli-core library hasn't been updated and still has dependencies v10.2.0 of azure-mgmt-resource. If I attempt to use the track 2 azure-mgmt-resource library instead, I end up getting warnings about incompatible versions of msal and msal-extensions.
Specifically, if I install azure-mgmt-resource (v15), and the install azure-cli-core, it forcibly regresses azure-mgmt-resource to v10 and reports:
ERROR: azure-identity 1.4.0 has requirement msal<2.0.0,>=1.3.0, but you'll have msal 1.0.0 which is incompatible.
ERROR: azure-identity 1.4.0 has requirement msal-extensions~=0.2.2, but you'll have msal-extensions 0.1.3 which is incompatible.
That said, if I install azure-cli-core first, then install v15 of azure-mgmt-resource and ignore the incompatibility error, the code actually works. (Error is: ERROR: azure-cli-core 2.12.1 has requirement azure-mgmt-resource==10.2.0, but you'll have azure-mgmt-resource 15.0.0 which is incompatible.) But this of course is not a viable workaround for customers.
To Reproduce
See above
1.
Expected behavior
There's a version of azure-cli-core that's compatible with track2 libraries.