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

ModuleNotFoundError: No module named 'azure.identity' in latest CLI (v2.36.0) #22192

Closed
mikesprague opened this issue Apr 26, 2022 · 6 comments
Closed
Assignees
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Installation
Milestone

Comments

@mikesprague
Copy link

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

After upgrading to the latest version of the CLI (v2.36.0) I have started receiving the following error:

Traceback (most recent call last):
  File "/github/workspace/python/rbac/list-rbac.py", line 21, in <module>
    from azure.identity import DefaultAzureCredential
ModuleNotFoundError: No module named 'azure.identity'

To Reproduce

from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()

Expected behavior

I expected it to find the import and continue processing. The above code works in v2.35.0 and below.

Environment summary

GH Workflow using GH Action azure/cli@v1 (CLI version v2.36.0). Additional details:

Current runner version: '2.290.1'
Operating System
  Ubuntu
  [2](https://github.com/CU-CommunityApps/ct-azure-scripts-templates/runs/6176459043?check_suite_focus=true#step:1:2)0.0[4](https://github.com/CU-CommunityApps/ct-azure-scripts-templates/runs/6176459043?check_suite_focus=true#step:1:4).4
  LTS
Virtual Environment
  Environment: ubuntu-20.04
  Version: 20220410.2
  Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220410.2/images/linux/Ubuntu2004-Readme.md
  Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220410.2
Virtual Environment Provisioner
  1.0.0.0-main-2022040[6](https://github.com/CU-CommunityApps/ct-azure-scripts-templates/runs/6176459043?check_suite_focus=true#step:1:6)-1

Additional context

As mentioned previously, pinning the workflow to v2.35.0 allows things to work again. I wouldn't expect a breaking change in a minor version update to the CLI so I have to assume this is a bug.

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Installation labels Apr 26, 2022
@ghost ghost assigned jiasli Apr 26, 2022
@ghost ghost added this to the Backlog milestone Apr 26, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 26, 2022

@jiasli for awareness

@jiasli
Copy link
Member

jiasli commented Apr 26, 2022

azure.identity was an internal dependency of azure-cli, so there is no guarantee it will always be available.

azure-identity conflicts with azure-cli-core 2.36.0 due to the conflicting dependency on msal-extensions. So the dependency on azure-identity was removed by #22124.

You may send your feedback to azure-identity at Azure/azure-sdk-for-python#23927. Once a new azure-identity is released, you may manually install azure-identity.

@mikesprague
Copy link
Author

mikesprague commented Apr 26, 2022

@jiasli Thanks for the info. I attempted adding pip install azure-identity to the GH Workflow but then it errors with the following:

Installing collected packages: msal-extensions, azure-identity
  Attempting uninstall: msal-extensions

    Found existing installation: msal-extensions 1.0.0

    Uninstalling msal-extensions-1.0.0:

      Successfully uninstalled msal-extensions-1.0.0

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
azure-cli-core 2.36.0 requires msal-extensions~=1.0.0, but you have msal-extensions 0.3.1 which is incompatible.

Is there a way to work with the latest release of the Azure CLI (v2.36.0) and the azure-identity package and/or is this just a waiting game for them to support the same msal-extensions version? Nvm, it seems they "fixed" it but haven't released a non-beta version yet. I will wait for that to be released.

@mikesprague
Copy link
Author

mikesprague commented Apr 26, 2022

It really feels like these releases should have been coordinated better on the MS/Azure side.

Referencing #24188 since that's the issue that will actually "fix" this.

Closing here since nothing will be addressed from this repo as best as I can tell.

@mikesprague
Copy link
Author

@jiasli Unless I missed it, there's no mention of this in the release notes: https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md#april-26-2022

Again, I would reiterate, it really feels like this change and the upcoming change to the Azure SDK for Python should have been communicated and coordinated better.

@jiasli
Copy link
Member

jiasli commented Apr 27, 2022

Unless I missed it, there's no mention of this in the release notes: https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md#april-26-2022

azure-identity is an internal dependency of Azure CLI, thus this change is not customer-facing.

It really feels like these releases should have been coordinated better on the MS/Azure side.

Again, I would reiterate, it really feels like this change and the upcoming change to the Azure SDK for Python should have been communicated and coordinated better.

Thanks @mikesprague for the feedback. We will certainly work more tightly with Azure SDK team to avoid such kind of issue from happening again in the future.

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 customer-reported Issues that are reported by GitHub users external to the Azure organization. Installation
Projects
None yet
Development

No branches or pull requests

3 participants