-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] Azure CLI auth fails when tenant is organizations #34387
Comments
Thanks for filing this, @jatinpuri-microsoft. @g2vinay @billwert please follow up ASAP. |
Hello @jatinpuri-microsoft! If you are expecting
Can you enable logging for the before and after and share that? |
Hi Bill,
The other az cli commands are working fine. In fact when we use the azure-sdk-bom dependency as 1.2.3, it seamlessly works (we have an application in production and have been using the pipeline for sometime now).
It is only when we move away from 1.2.3 to newer versions (1.2.5+), do things stop working. The moment we revert back to 1.2.3, it works again.
Regards,
Jatin
…________________________________
From: Bill Wert ***@***.***>
Sent: Tuesday, April 11, 2023 1:41 AM
To: Azure/azure-sdk-for-java ***@***.***>
Cc: Jatin Puri ***@***.***>; Mention ***@***.***>
Subject: Re: [Azure/azure-sdk-for-java] [BUG] Azure Identity Auth fails post azure-identity is upgraded (Issue #34387)
Hello @jatinpuri-microsoft<https://github.com/jatinpuri-microsoft>! If you are expecting az authentication to work, is it possible it's not logged in when running in the pipeline?
AzureCliCredential authentication unavailable. Please run 'az login' to set up account. To further mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/java/identity/azclicredential/troubleshoot
Can you enable logging<https://learn.microsoft.com/en-us/azure/developer/java/sdk/logging-overview> for the before and after and share that?
—
Reply to this email directly, view it on GitHub<#34387 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AZTMAKXY2ST35SCVNBPFYW3XARSPVANCNFSM6AAAAAAWY4RYGE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The reason I ask is we only hit the error text you're seeing in when |
Hi Bill. We have a reproducible. When used against azure-sdk-bom 1.2.3, everything seems to work fine. But when we carve out a branch and use 1.2.11, it results in the above errors. The moment we roll back from 1.2.11 to 1.2.3. Things work again. So I am not really sure if the environment is the problem. Note, we are facing this problem only when running on Azure Devops and not locally. Note: Just before I run |
I ran into the same issue on my Mac. I am able to create resources using Azure CLI, but the azure-identity says "Azure Identity => Attempted credential AzureCliCredential is unavailable." Both My
|
After some debugging, I found out that the error message should not be ERROR: AADSTS500011: The resource principal named api://xxxxxx/user.impersonation was not found in the tenant named xxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. |
Thanks for digging in, @saragluna. I'll investigate further. |
Following up on this again. This is still an open issue for us. We are unable to migrate to the latest version of the azure-sdk because of this. The one we are using has vulnerabilities reported and need to migrate sooner. Kindly please help |
@saragluna It looks like your issue is unrelated to @jatinpuri-microsoft's. In your case, with logging enabled did you see the output you shared here? I believe you should have. If so, that is the expected behavior. You should not have seen the |
@jatinpuri-microsoft I need you to share the output of the logging when it works, please. |
Describe the bug
This issue is observed when we upgrade the azure-sdk-bom from 1.2.3 to 1.2.5.
We have a suite of tests that work perfectly fine locally, and as well when triggered via azure devops pipelines (via service connection). This is used against azure-sdk-bom 1.2.3. As part of tests, the code authenticates against azure storage account, event grid etc.
When tried against any version post that (say 1.2.5 or 1.2.11), all the tests start to fail.
These tests work locally but not when run by azure devops pipeline. This issue can only be found in the newer versions.
I see an update-log here: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/CHANGELOG.md#154-2022-08-08
Not sure if this is creating trouble
Code Snippet
And we specify the service connection here:
Expected behavior
Expected it to work with newer versions, as it did with older versions.
Can confirm az cli installed on the underlying host
Setup (please complete the following information):
The text was updated successfully, but these errors were encountered: