Sobansky
Sobansky

Reputation: 474

An attempt to communicate with Azure DevOps failed because a token could not be retrieved

I have projects that I have controlled be Azure DevOps. Every time when I open some of these solutions in the Visual Studio I get following error in the team explorer:

enter image description here

So when I re-enter my credentials I get the same error again. But when I restart Visual Studio my project is suddenly properly connected to Azure DevOps.

Could you tell me why I have this issue and how to solve it?

Upvotes: 28

Views: 18287

Answers (5)

tomRedox
tomRedox

Reputation: 30443

I've just had this same error as part of a wider issue with not being able to clone my DevOps projects, getting "connection reset" messages in Chrome and general weird behaviour for anything that tried to use my Microsoft login.

After a lot of hunting around, the cause of the issue turned out to be the Intel Killer wifi service. I opened the Killer Control Center app and turned off everything and all the issues disappeared:

Killer settings showing everything switched off

Once I'd found the cause, a bit of googling turned up this post that suggests the Killer Prioritization Engine may be the root cause:

Bruno Nepomuceno 馃幃 [MSFT] 路路路 I had the same issue and after a long time I found out what was going on. My network card has a feature called "Killer (I know, ironic) Prioritization Engine" and that was on. Somehow it was interfering with the connection with Azure DevOps. When I turned it off (and you can do it using the Killer Control Center app), it started working.

July 2024 update

I just had issues with this again, this time Microsoft Teams started being very slow when sending messages and particularly when uploading images. It turned out that the Killer app had decided to reenable the 'Killer Prioritization Engine' and 'Auto bandwidth' switches again. So, the moral is beware that this may turn itself back on again.

Upvotes: 1

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31023

You may try the following items:

  1. Go to Control Panel > Credential Manager, and remove all Windows Credentials related to TFS.
  2. Close all Visual Studio instances, and delete the %LOCALAPPDATA%\.IdentityService folder if it exists.
  3. Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\x.0\Cache
  4. As @4c74356b41 mentioned, repair VS.

Upvotes: 40

Mitch Waterson
Mitch Waterson

Reputation: 51

Much easier solution to this. Close any open visual studio instances, restart visual studio as an administrator and connect to your ADO instance, i got this issue on cloning a repo personally, when i re-tried cloning again via web ADO the next time VS opened it worked just fine.

Upvotes: 1

Kezzla
Kezzla

Reputation: 209

The same issue is still occurring in 2021. I had tried the sign out/sign in method, I had tried the local app data deletion method. No luck with either.

What worked for me were the following steps.

  • Click on your name in the top right corner of Visual Studio and select Account Settings
  • Now rather than signing out, look below this to the All Accounts section. On some it will say "We need to refresh the credentials for this account"
  • Re-enter your credentials here.

This fixed the issue for me. I hope this helps someone else with this annoying issue.

Upvotes: 7

Justin Tolchin
Justin Tolchin

Reputation: 463

As stated above, try doing only this step and see if it fixes the problem. It did for me.

  • Close all Visual Studio instances, delete %LOCALAPPDATA%.IdentityService if it exists.

It saves doing all the other steps.

Upvotes: 11

Related Questions