Connect to SQL Database in Visual studio 2017 via Active directory

  • Hello!

    I am authenticating my SQL database via active directory. Now when I am trying to connect to the database via Visual studio then the connection is failing because of login in windows authentication. The problem is I am using laptop given by my employer to work for client. So the windows authentication fails since it takes my employer login and not my client's. Active directory option works for SQL server management studio but fails in visual studio. I can not use SQL server authentication. How can I now connect to my client's DB using active directory in Visual studio 2017?

     

    Regards

    Priya

  • The database lies on Azure storage.

  • Connections should be exactly the same. What's the error?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hi Grant

    This is the error I am getting.

    TITLE: Microsoft SQL Server Native Client 11.0

    ------------------------------

    Windows logins are not supported in this version of SQL Server.

    <hr />

    Regards

    Priya

  • Sounds like you're not logging in correctly to Azure then. You can only use Azure Active Directory, not the regular kind, or, a SQL login, which you say you don't have. It's also possible that you're hitting a firewall rule, but not if, from the same machine, you're connecting through SSMS. No, it sounds like SSMS is running under an account that has access and Visual Studio is not. Just change how it's logged in. Do a "run as". See if that works.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply