If you’re seeing an error like this one above when connecting to Visual Studio Team Services (VSTS) from Office apps, git clients, or Visual Studio (to name a few), first try to repro outside those apps. The following steps perform the same sort of connection, only directly to AAD:
- Install Azure PowerShell (https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure)
- Open PowerShell
- Run Login-AzureRmAccount and continue through the prompts
If you see the same error the fix is to enable Forms Authentication in AD FS. If you require assistance doing this or with anything in AD FS, please contact Microsoft Azure AD Support at https://portal.azure.com/#create/Microsoft.Support.
“How to troubleshoot sign-in issues with Office modern authentication when you use AD FS”