- Azure Identity:
- 1.12:
- Windows 11:
- Python 3.7:
Describe the bug
AzureCliCredential returns an ClientAuthenticationError when azure cli is not installed, on a Chinese windows installation.
The correct error to return is a CredentialUnavailableError, which is returned if using English language version of Windows. Returning the wrong error, makes it not possible to use AzureCliCredential in a ChainedTokenCredential chain.
I belive this bug is because AzureCliCredential is hardcoded to look for the English text:
ex.stderr.startswith("'az' is not recognized")
To Reproduce
Steps to reproduce the behavior:
- Use a Chinese version of Windows 11.
- Attempt to use AzureCliCredential, without having
azure cli installed
Expected behavior
I expect the CredentialUnavailableError to be returned, not ClientAuthenticationError.
Screenshots

Describe the bug
AzureCliCredentialreturns anClientAuthenticationErrorwhenazure cliis not installed, on a Chinese windows installation.The correct error to return is a
CredentialUnavailableError, which is returned if using English language version of Windows. Returning the wrong error, makes it not possible to useAzureCliCredentialin aChainedTokenCredentialchain.I belive this bug is because AzureCliCredential is hardcoded to look for the English text:
ex.stderr.startswith("'az' is not recognized")
To Reproduce
Steps to reproduce the behavior:
azure cliinstalledExpected behavior
I expect the
CredentialUnavailableErrorto be returned, notClientAuthenticationError.Screenshots