-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Azure CLI will currently *always* cause AzureCliCredential to fail on Python/MacOS/Homebrew using secret-client. #27111
Comments
Hi @furnivall, 2.50.0 is not the latest Azure CLI(2.51.0). Please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli. |
Thank you for opening this issue, we will look into it. |
No problem, if you need anything specific about my setup I am happy to provide. Just spent the day bashing my head against the computer to work out why I wasn't able to connect keyvault to my local environment! |
Also, your bot is broken - it's physically impossible for MacOS users with Homebrew to upgrade to this version at current. No idea where to raise a bug ticket but might be worth doing something about. edit: scratch that, have raised #27112 |
I believe you are talking about Azure/azure-sdk-for-python#31493 You are seeing the
See #17886 (comment) |
Azure CLI's Automatic Update is indeed guarded by a azure-cli/src/azure-cli/azure/cli/__main__.py Lines 97 to 104 in 2c3f5e0
When Python SDK subprocesses kwargs: Dict[str, Any] = {
"stderr": subprocess.PIPE,
"cwd": working_directory,
"universal_newlines": True,
"timeout": timeout,
"env": dict(os.environ, AZURE_CORE_NO_COLOR="true"),
}
return subprocess.check_output(args, **kwargs) https://docs.python.org/3/library/subprocess.html#frequently-used-arguments
See #17886 (comment) |
I can't decide if this is related or not, but — for what it's worth — I'm having a similar issue with the Java SDK using CLI credentials, and patching the CLI to 2.65.0 has resolved the issue. $ az upgrade
Your current Azure CLI version is 2.63.0. Latest version available is 2.65.0.
... Previous error was:
|
Describe the bug
Preface:
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 & #27047 so I did a bit of digging.
I'll also raise a sister issue on azure-sdk-for-python so they're aware of it too.
Description:
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.
This is because the cli prompt returned by
az account get-access-token --output json --resource <whatever>
embedded within that file will always return the following, which requires a user response to complete.Steps to reproduce:
I have been able to confirm this on a minimal reproduction here. It will require the replacement of some env vars:
func start
to startreturn subprocess.check_output(args, **kwargs)
venv/lib/python3.10/site-packages/azure/identity/_credentials/azure_cli.py
- github link to specific linecurl http://localhost:7071/api/hello
to trigger the http functionRelated command
All azure commands that trigger an update notification, but specifically
az account get-access-token --output json --resource <whatever>
in this instanceErrors
Executing 'Functions.AzureTrigger' (Reason='This function was programmatically called via the host APIs.', Id=df95b1b4-cdce-4775-abe4-71e6f6cab282)
DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
Issue script & Debug output
N/A, description covers it.
Expected behavior
Auth token to be generated as standard.
Environment Summary
Additional context
I am fairly certain this won't just be hitting the python sdk, and definitely not just function apps.
The text was updated successfully, but these errors were encountered: