This post was most recently updated on September 25th, 2021.
3 min read.This article will describe a number of fixes to a situation, where your Visual Studio Cloud Explorer fails to show you the Azure Subscriptions you (should) have access to.
Problem
Your Cloud explorer might load for a long while, and finally, fail to display anything meaningful. Instead, you might see an error like the below:
Solution
This one was not fun. There are quite a few different reasons why your Visual Studio might suddenly struggle with your accounts.
Below, I’ll explain a couple of steps you can try to remove the offending guest organizations.
Time needed: 30 minutes
How to fix Visual Studio Cloud Explorer being unable to access your subscriptions?
- Try re-entering your credentials
Ah well, this one is almost certainly not going to help, but it’s worth trying.
- The first step – try removing and re-adding the credentials
I’ve found extremely varying degrees of success for this step.
1. Cloud Explorer
2. Manage Accounts
3. In the “All accounts” section, “Remove” all your accounts
4. Restart your Visual Studio
5. Re-enter your credentials
If Cloud Explorer now works, great! If it doesn’t, proceed to the next step.
Additionally, if you get login prompts to any Azure AD organizations where you’re a guest (and logging in fails), make note of that – step 5 will handle any offending organizations like that! - First option: Disable authenticating against quest directories
This is an easy first thing to try – disabling authenticating against guest directories might help you, at least get access to your primary directory’s resources, even if it doesn’t completely fix the issues with obsolete accounts.
You can find the right setting from the Options by following the path below:
Tools > Options > Accounts > Uncheck “Authenticate across all Azure Active Directories on sign-in”
Additionally, you could try changing the built-in, embedded web browser to a “System web browser”, which will eliminate any caches in the built-in Trident engine in Visual Studio. - Continue by nuking the Visual Studio’s IdentityService cache
This is something that’s good to do regardless of whether the first step was successful or not, to get the Cloud Explorer to let go of any obsolete credentials.
First, close down all Visual Studio Instances.
Then, navigate to %LocalAppData% (usually something like “C:\Users\YourUser\AppData\Local“
Finally, remove a folder called “.IdentityService” (if you can’t see it, enable showing hidden files and folders)
This will reset your Cloud Explorer.
Don’t start Visual Studio at this point, though! - Try leaving any guest organizations
In case you have been invited to any external organizations, where you are as a guest user in their Azure Active Directory tenant, being unable to log in to any of those tenants might cause displaying your Azure subscriptions to fail.
This seems to happen at least if you’ve been invited to be an active Azure user (like a Resource Group co-administrator), but then your log-in has been blocked.
You can leave any external organizations from “My Account” > Organizations. You can see a detailed outline of these steps from this blog article:
How to remove your account as a guest in another Azure AD tenant? - Re-login to your accounts on Visual Studio Cloud Explorer
Cloud Explorer uses the identities that are configured to your Visual Studio deployment. Since you have just nuked the Identity Service, none should be configured at this point.
You can add your account from File > Account Settings > Sign In, or Cloud Explorer > Account Management (that’s the little person icon) > Sign In.
After a long-ish loading time, Cloud Explorer should display resources from your primary account without trying to authenticate against any foreign directories at this point!
… and that’s it! You should be good.
References
- Simple instructions that sometimes help:
- Similar issues:
- https://developercommunity.visualstudio.com/content/problem/16197/we-could-not-add-account-failed-to-refresh-access.html
- https://developercommunity.visualstudio.com/content/problem/529037/visual-studio-20172019-wont-display-azure-subscrip.html
- https://developercommunity.visualstudio.com/content/problem/17315/cant-add-new-account-with-vsts-online-failed-to-re.html
- http://blog.repsaj.nl/index.php/2017/04/vs2017-unable-to-login-failed-to-refresh-access-token/
- https://social.msdn.microsoft.com/Forums/Lync/en-US/f19fb4b2-9646-4cb8-af33-3cfae955c60d/disable-b2b-collaboration-federation?forum=WindowsAzureAD
- Merging on GitHub Actions fails with “could not read Username for ‘https://github.com’: No such device or address”? - December 24, 2024
- How to close the Sidebar in Microsoft Edge - December 17, 2024
- How to stop Surface Headphones from autoplaying audio when you place them on the desk? - December 10, 2024