I kept getting this error in both VS2017 and 2017.3 Preview. The issue apparently appears if you change your primary MSA e-email.
The solution is to reset the identity service for VS. So close all instance of VS and delete the following folder: %LOCALAPPDATA%\.IdentityService.