Open TheOnlyWei opened 2 years ago
Hi Wei, Can you reproduce this issue in your environment? Can you share your environment to us?
@dingmeng-xue No, we don't have a consistent reproduction of this issue after I applied the fix. This is not a per environment bug, but one where if you have multiple environments/accounts, it causes weird behavior when trying to use commands like Get-AzResourceGroup. It seems like accounts are being mixed up.
I have backed up the .Azure and .IdentityService folders created during when the bug could be reproduced consistently, but I don't know where are the sensitive informations to redact, so I did not upload it.
Hi Wei, you need to filter out all secret values from context file. Then it should be safe. In addition, we will add more debug information into Az.Accounts. Please try it when new Az.Accounts is released.
Description
I am running Azure Stack Hub. After logging in and calling Get-AzResourceGroup
Getting this error: Get-AzResourceGroup: Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.
The solution is to call: Clear-AzContext -Scope CurrentUser -Force Clear-AzContext -Scope Process -Force
Steps to reproduce
Have many contexts in
get-azcontext -ListAvailable
. I was using an environment where I had 3 contexts for 3 different accounts, there were also many many contexts for other azure stack environments as well as azure cloud. We think the root cause might be that MSAL might be confusing different contexts with each other. The debug error contains this:This seems to indicate that something thinks there are multiple CloudAdmin@azs-long05-int.selfhost.corp.microsoft.com accounts, but there is only one. Log into said account and call Get-AzResourceGroup and get the error below:
Environment data
Module versions
Debug output
Error output
Unfortunately, I do not know how to reproduce this error to get resolve-azerror output.