Connect to SQL Database in Visual studio 2017 via Active directory

  • piu.scorpio

    SSC Enthusiast

    Points: 120

    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

  • piu.scorpio

    SSC Enthusiast

    Points: 120

    The database lies on Azure storage.

  • Grant Fritchey

    SSC Guru

    Points: 395510

    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

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

  • piu.scorpio

    SSC Enthusiast

    Points: 120

    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

  • Grant Fritchey

    SSC Guru

    Points: 395510

    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

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

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

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