Hello Omar Saleh,
Thank you for reaching out to MS Q&A. I am here to assist you in resolving your issues.
The order of credential evaluation in DefaultAzureCredential varies depending on the version of the Azure Identity library.
• In the first image, AzurePowerShellCredential appears before AzureCliCredential.
• In the second image, AzureCliCredential comes before AzurePowerShellCredential.
The correct order depends on the version of the Azure.Identity library you are using:
Before version 1.10.0, the order was: EnvironmentCredential → ManagedIdentityCredential → SharedTokenCacheCredential → VisualStudioCredential → AzurePowerShellCredential → AzureCliCredential → InteractiveBrowserCredential.
From version 1.10.0 and later, the order was updated. As of v1.14.0 (seen in the second screenshot), the order is:
EnvironmentCredential
WorkloadIdentityCredential
ManagedIdentityCredential
SharedTokenCacheCredential
VisualStudioCredential
AzureCliCredential
AzurePowerShellCredential
AzureDeveloperCliCredential
InteractiveBrowserCredential.
In Azure.Identity v1.14.0, the correct order is: AzureCliCredential first, followed by AzurePowerShellCredential.
You can verify your exact version by checking your project’s csproj or package.json file, or by running: dotnet list package | findstr Azure.Identity tr Azure.Identitytr Azure.IdentityIf the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Siri