question

TJGrist-7734 avatar image
0 Votes"
TJGrist-7734 asked ·

Cannot authenticate from visual studio 2019

I am remoting into a Windows server 2012 machine. I can authenticate the acct from a browser (chrome) and login to Azure devops. However when I try to login via Visual Studio I get the following error:

We could not add the account AADSTS51004: The user account does not exist in the directory. To sign into this application, the account must be added to the directory. Trace ID ba621e6d-e6fc-4ac5-80c6-1abffab60d00 Correlation ID: a0573630-a419-41a4-9ac0-e247a43c7c1a Timestamp: 2019-12-02 18:26:16Z

When I examine the directory in question, the acct appears to already be in the directory.

azure-active-directory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

neray-MSFT avatar image
0 Votes"
neray-MSFT answered ·

@TJGrist-7734

The error message states that the account is not not in the tenant when you are trying to sign in from the Visual Studio 2019.

This is what I believe could be happening - when you are signing in from the browser you are logging in to a tenant, lets say Tenant 2.
However, when you are in Visual Studio it is generally where you are working on your Azure Resources. So the tenant which the Subscription, lets say Subscription 1, is associated with would be a different tenant, like Tenant 1.

So here's what I suggest - when you login to the browser, check if you are able to view the Azure Resources (without changing the directory). If not, use an account credential from the Tenant associated with the Subscription and try again.


Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.




· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.