In Visual Studio Code, I cannot connect SQL Tools Microsoft SQL Server/Azure to the Azure SQL DB.

JP_BW 60 Reputation points
2025-03-17T13:44:48.1166667+00:00

"SQL Tools Microsoft SQL Server/Azure", the driver for SQL Tools in Visual Studio Code, seems unable to connect with my Azure SQL Database account's sole logical server.

I am able to make connection from Visual Studio Code (VSC) to Azure SQL Database (Az SQ DB).
Incidentally, I am also able to make that connection from SSMS.

In VSC, I can successfully run query SELECT 1;

However, when I run other queries (eg to find foreign keys), I am told I don’t have an extension for debugging SQL. VSC offers to find one in the Marketplace, but CoPilot didn't see any point in the ones found (& neither do I).

CoPilot thought the message meant VSC wasn't recognising the MSSQL extension, so recommended installing SQLTools. SQL Tools seemed to or it to work, it seemed to need "SQL Tools Microsoft SQL Server/Azure" - the driver.

Hence, I installed that....but encountered the issue described at start of this description.

The error on Test Connection is "Error opening connection Cannot open server "xxx" requested by the login. The login failed". This was baffling because "xxx" in the error codes it my username, not the server address inputted to the Connection Assistant

Steps taken may be summarised as: verify server address, check firewall rules, close/reopen VSC, remove all connections and reinstate and close/reopen VSC.

SQL Server Database Engine
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2025-03-17T17:38:18.4333333+00:00

    "SQL Tools Microsoft SQL Server/Azure" is a 3rd party VSC extension. You should contact the author with questions.

    https://github.com/mtxr/vscode-sqltools/issues?utm_source=vsmp&utm_medium=ms%20web&utm_campaign=mpdetails

    you might try the MS official extension:

    https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.