Visual Studio picks the wrong tenant id in an attempt to login Azure in the integrated Microsoft Identity platform tool, I do not have such a GUID that it shows me, my tenant id Guid is different for the user, and user name is shown right in the error message. I tried to search the GUID that it shows me (starting at f8cd..) in Azure portal, but was not able to find anything, no idea where VS takes it from, could be some old one that I used long in the past.
I restarted studio, rebooted Windows, signed out, signed in, nothing helps. I clean up \AppData\Local\.IdentityService\AzureServiceAuth
, it did not help either.
When I type az account show
in the cmd, it displays right user and right tenant id with home tenant id
Checking/unchecking the box in VS settings does not help either
Need to check below steps:
Goto the account settings
on the top right corner of the Visual studio and remove all the existed logged in accounts and reenter your credentials with the required one. This will help you to resolve the cache issue.
Refer SO worked by me for more relevant information.
control panel >> User accounts >> Credential Manager >> Windows Credentials
Remove the Visual Studio credentials as shown in the image and add it.
Tools > Import and Export Settings > Reset all settings
.Or
Tools >> Options >> Environment >> Accounts >> Clear all the logged in accounts.
Control Panel >> Programs and Features >> Microsoft Visual Studio >> Change >> Repair
If still the issue persists, uninstall the visual studio and reinstall it with the latest version from Visual studio official site.