command line interface – Azure CLI `AZ LOGIN` ERROR: “Found multiple accounts with the same username”

I’m getting this error whenever I try to login to Azure via the CLI. Here are the details:

PS C:\Users\MyName> az login  
Please select the account you want to log in with  

(Now I get a popup browser window where both accounts have the same username/email):
enter image description here

Found multiple accounts with the same username 'me@<redacted>.com': [{'home_account_id': 
'00000000-0000-0000-8413-<redacted>.9188040d-6c67-4c5b-b112-<redacted>', 'environment': 
'login.microsoftonline.com', 'username': 'me@<redacted>.com', 'authority_type': 'MSSTS',
 'local_account_id': 'ff37078a-25ee-4ca8-a555-<redacted>', 'realm': '2c5b6192-50ca-4e45-
869a-<redacted>'}, {'home_account_id': 'cd1796cb-a338-4267-8b6e-<redacted>.1a8ba571-a143
-461a-aac3-<redacted>', 'environment': 'login.microsoftonline.com', 'username':  'me@<re
dacted>.com', 'authority_type': 'MSSTS', 'local_account_id': 'cd1796cb-a338-4267-8b6e-<r
edacted>', 'realm': 'organizations'}]  
Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168
  1. The 2nd account (PERSONAL) is the one I am interested in using
  2. I have tried:
    1. logging in multiple times — NO GO
    2. the az account clear command from the PS prompt (to clear the cache) — NO GO
    3. checked to see if I am missing an MFA on my phone — NO GO
    4. logging out via az logout and then logging back in via az login — NO GO

Read more here: Source link