This is a quick note when Visual Studio 2017 cannot refresh credentials. It usually occurs when you change the microsoft account you use to login to your computer.
Make sure Visual Studio is closed before doing all this
Go to %localappdata%/.IdentityService
Delete IdentityServiceAdalCache.cache (You can also Delete the .IdentityService folder if you like)
Restart computer for good measure if you like
Reenter credentials in Visual Studio ( sometimes you can delete the account first before reentering it again)
All done 🙂