-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Current azure-cli-core not compatible with track2 management libraries #14212
Comments
azure-cli-core |
As of azure-identity 1.4.0, applications can use either AzureCliCredential or DefaultAzureCredential to authenticate as the identity signed in to the CLI. This is implemented by invoking the CLI in a subprocess, so I expect it's less performant than azure-cli-core but still acceptable for local development and scripting. |
OK, so examples that have been using azure.common.client_factory.get_client_from_cli_profile should be switched over to using AzureCliCredential, correct? I tried it and it worked as expected (without needing a role assignment), but I want to make sure that AzureCliCredential is intended to be used in this way. @lmazuel Changing to AzureCliCredential will mean removing azure.common references, except for one piece in the auth article that notes the legacy usage. However, I can't full make that change until the azure.mgmt.web and azure.mgmt.rdbms libraries are updated to track2. |
Right, there's nothing special about |
@lmazuel Given the discussion here, is it proper to not expect azure-cli-core to be suitably updated for track2? If that's the case, then I can close this issue. |
@kraigb , if we need update azure-cli-core, we'll create issue in https://github.com/Azure/azure-cli/issues for us to track as this repo is only for python SDK. |
Web ant93 release: Updating API version to 2021-01-01 (Azure#14489) * Adds base for updating Microsoft.Web from version stable/2020-12-01 to version 2021-01-01 * Updates readme * Updates API version in new specs and examples * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.… (Azure#14212) * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Add custom word * Actually bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Update AppServicePlan.json with preoperty (Azure#14388) Adding ElasticScaleEnabled to ASP object! * Swagger changes for kubeenv (Azure#14417) * Swagger changes for kubeenv * Add examples for create and update * Fixing model validations in examples * Supress systemData for kubeenvironments.json * Making small change to trigger a re-run of ApiReview runner * Fixing extendedLocation bug in swagger * fix model validation * Carry over missing Acr properties from previous version (Azure#14490) * [python]Update readme.python.md (Azure#14493) * Update readme.python.md * Update readme.md Co-authored-by: jocawtho <[email protected]> Co-authored-by: JennyLawrance <[email protected]> Co-authored-by: msyyc <[email protected]>
Web ant93 release: Updating API version to 2021-01-01 (Azure#14489) * Adds base for updating Microsoft.Web from version stable/2020-12-01 to version 2021-01-01 * Updates readme * Updates API version in new specs and examples * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.… (Azure#14212) * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Add custom word * Actually bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Update AppServicePlan.json with preoperty (Azure#14388) Adding ElasticScaleEnabled to ASP object! * Swagger changes for kubeenv (Azure#14417) * Swagger changes for kubeenv * Add examples for create and update * Fixing model validations in examples * Supress systemData for kubeenvironments.json * Making small change to trigger a re-run of ApiReview runner * Fixing extendedLocation bug in swagger * fix model validation * Carry over missing Acr properties from previous version (Azure#14490) * [python]Update readme.python.md (Azure#14493) * Update readme.python.md * Update readme.md Co-authored-by: jocawtho <[email protected]> Co-authored-by: JennyLawrance <[email protected]> Co-authored-by: msyyc <[email protected]>
* CodeGen from PR 14489 in Azure/azure-rest-api-specs Web ant93 release: Updating API version to 2021-01-01 (#14489) * Adds base for updating Microsoft.Web from version stable/2020-12-01 to version 2021-01-01 * Updates readme * Updates API version in new specs and examples * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.… (#14212) * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Add custom word * Actually bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Update AppServicePlan.json with preoperty (#14388) Adding ElasticScaleEnabled to ASP object! * Swagger changes for kubeenv (#14417) * Swagger changes for kubeenv * Add examples for create and update * Fixing model validations in examples * Supress systemData for kubeenvironments.json * Making small change to trigger a re-run of ApiReview runner * Fixing extendedLocation bug in swagger * fix model validation * Carry over missing Acr properties from previous version (#14490) * [python]Update readme.python.md (#14493) * Update readme.python.md * Update readme.md Co-authored-by: jocawtho <[email protected]> Co-authored-by: JennyLawrance <[email protected]> Co-authored-by: msyyc <[email protected]> * version,CHANGELOG * test * test fix Co-authored-by: SDKAuto <[email protected]> Co-authored-by: jocawtho <[email protected]> Co-authored-by: JennyLawrance <[email protected]> Co-authored-by: msyyc <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
* CodeGen from PR 14489 in Azure/azure-rest-api-specs Web ant93 release: Updating API version to 2021-01-01 (#14489) * Adds base for updating Microsoft.Web from version stable/2020-12-01 to version 2021-01-01 * Updates readme * Updates API version in new specs and examples * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.… (#14212) * Bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Add custom word * Actually bring in swagger for Microsoft.CertificateRegistration and Microsoft.DomainRegistration RPs * Update AppServicePlan.json with preoperty (#14388) Adding ElasticScaleEnabled to ASP object! * Swagger changes for kubeenv (#14417) * Swagger changes for kubeenv * Add examples for create and update * Fixing model validations in examples * Supress systemData for kubeenvironments.json * Making small change to trigger a re-run of ApiReview runner * Fixing extendedLocation bug in swagger * fix model validation * Carry over missing Acr properties from previous version (#14490) * [python]Update readme.python.md (#14493) * Update readme.python.md * Update readme.md Co-authored-by: jocawtho <[email protected]> Co-authored-by: JennyLawrance <[email protected]> Co-authored-by: msyyc <[email protected]> * version,CHANGELOG * test * test fix Co-authored-by: SDKAuto <[email protected]> Co-authored-by: jocawtho <[email protected]> Co-authored-by: JennyLawrance <[email protected]> Co-authored-by: msyyc <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
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.
The text was updated successfully, but these errors were encountered: