-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
- Package Name: azure-identity
- Package Version: 1.23
- Operating System: Windows
- Python Version: 3.12.0 - 3.12.7
Describe the bug
The error occurs when using AzureCliCredential with Python version 3.12.0 - 3.12.7.
The AzureCliCredential get_token_base uses shutil.which to locate the Az Cli-executable. For the named Python-versions, shutil.which returns the path to the az-executable used by e.g. PowerShell, although Python needs the path to the az.CMD-executable.
A part of shutils.which for Python version 3.12.0 on Windows is implemented using this: files = [cmd] + [cmd + ext for ext in pathext] where [cmd] is equivalent to [az].
The first part returns the the path to az-executable, which returns "Failed to execute 'c:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az'" for subsequent subprocess-calls. This is later removed by patched versions of Python 3.12.
To Reproduce
Steps to reproduce the behavior:
- Install Python 3.12.0
- Run AzureCliCredential with get_token("./default")
Metadata
Metadata
Assignees
Labels
Type
Projects
Status