Skip to content

Azure CLI will *always* cause AzureCliCredential to fail on unupgraded Python/MacOS/Homebrew builds using secret-client. #31493

@furnivall

Description

@furnivall
  • Package Names:
    azure-common==1.1.28
    azure-core==1.28.0
    azure-identity==1.13.0
    azure-keyvault==4.2.0
    azure-keyvault-certificates==4.7.0
    azure-keyvault-keys==4.8.0
    azure-keyvault-secrets==4.7.0
  • Operating System: MacOS
  • Python Version: 3.10 (I know this isn't supported, but it makes no difference here)

Describe the bug
DefaultAzureCredential runs through a bunch of options, including AzureCliCredential.

When it reaches this line within AzureCliCredential, it will always fail the timeout with an outdated software version, as the cli prompt returned by az account get-access-token --output json --resource <whatever> embedded within that page will always return the following which requires a user response:

New Azure CLI version available. Running 'az upgrade' to update automatically.
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Your current Azure CLI version is 2.50.0. Latest version available is 2.51.0.
Please check the release notes first: https://docs.microsoft.com/cli/azure/release-notes-azure-cli
Do you want to continue? (Y/n):

To Reproduce
Steps to reproduce the behavior:

  1. Replace key_vault_url and secret_name within x/function_app.py with some legitimate values.
  2. Use func start to start
  3. Optionally, attach a debugger of your choice to the process and watch the call to return subprocess.check_output(args, **kwargs) venv/lib/python3.10/site-packages/azure/identity/_credentials/azure_cli.py - github link to specific line
  4. Run curl http://localhost:7071/api/hello to trigger the http function
  5. Read your logs for the following string: AzureCliCredential: Failed to invoke the Azure CLI

Expected behavior
Standard auth flow to work in the usual way.

Screenshots
Attached debugger showing the point where the timeout occurs:
image

Additional context
This may well be intended behaviour, so I apologise if so. However, I am currently unable to upgrade Azure CLI locally due to Homebrew/homebrew-core#138158 & Azure/azure-cli#27047 so I did a bit of digging.
I presume this probably hits in other areas than just my specific area of focus so it may be worth passing this on to other devs.

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