Skip to content

AzureCliCredential does not work as intended when using a Chinese version of Windows #27965

@tboerstad

Description

@tboerstad
  • 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:

  1. Use a Chinese version of Windows 11.
  2. Attempt to use AzureCliCredential, without having azure cli installed

Expected behavior
I expect the CredentialUnavailableError to be returned, not ClientAuthenticationError.

Screenshots

image

Metadata

Metadata

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions