Using SSMS SQLCMD to connect to Azure SQLDB via Entra Auth

Salah Mahmood 0 Reputation points
2025-03-18T14:42:34.2366667+00:00

I am struggling to find a way to connect to an Azure SQL SB, via SSMS:
SQL Server Management Studio 20.1.10.0

I have used:

:connect <Servername> -G

The response is:
A fatal scripting error occurred.

Incorrect syntax was encountered while parsing :connect.

Completion time: 2025-03-18T14:39:08.4309506+00:00

When I try to specify a user name and password:

:connect <Servername> -U <email address> -P <password>

It doesn't take the full email address (Perhaps because of the @ symbol)

Is there a way to connect to an Azure DB using SSMS and SQLCMD ?

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

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2025-03-18T22:08:05.9766667+00:00

    It seems that this is not supported, see https://learn.microsoft.com/en-us/sql/tools/sqlcmd/edit-sqlcmd-scripts-query-editor?view=sql-server-ver16.

    I agree that this is a surprising shortcoming. You can file a request for an enhancement at https://developercommunity.visualstudio.com/SSMS

    0 comments No comments

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.