-
Notifications
You must be signed in to change notification settings - Fork 192
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] AzureCliCrededentials json format changed #1329
Comments
new CLI should be on MSAL, but this lib stays at ADAL. The lib is in maintenance mode, and to be deprecated. Please plan switch to https://aka.ms/azsdk/dotnet/mgmt |
For this particular issue I don't think it is ADAL/MSAL related. The |
I had an issue with the AzureCliCredentials and wanted to check the source code. I looked at the implementation here and thought I'd bumped into the unsupported old json issue, but I was actually using the newer library Azure.Identity. The implementation in here (old) directly reads the json file, but the implementation in Azure.Identity directly calls the Azure cli and does not have the issue. |
Yes, the current solution would be call CLI and let it fetch the result. However, I am not sure whether it works same, if CLI is an old version (before they've moved to MSAL). As mentioned by @rvdginste, the JSON format changed (or even file location). Whether it is ADAL/MSAL is now internal to CLI. |
I understand, but now people depending on this library find their software being in an unusable state since it no longer works with an updated azure-cli. It is possible to combine the credentials provided by |
Describe the bug
A clear and concise description of what the bug is.
The format of the
json
files that are used by azure-cli to store the access tokens has changed. Therefore theAzureCliCredentials
fails to parse the tokens that are used for logging in using a service principal.Old format & location:
New format & location:
Exception or Stack Trace
Add the exception log and stack trace if available
To Reproduce
Steps to reproduce the behavior:
az logout
(to clear the~/.azure
folder)az login --service-principal -u '** GUID **' -p '** TOKEN **' --tenant '** GUID **'
AzureCliCredentials.Create()
Code Snippet
Add the code snippet that causes the issue.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
Microsoft.Azure.Management.Fluent@1.38.1
Additional context
Add any other context about the problem here.
https://github.com/Azure/azure-libraries-for-net/blob/master/src/ResourceManagement/ResourceManager/Authentication/AzureCliCredentials.cs#L45
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: