Azure SQL Server and SQL managment studio

Bobby Mahaffey 21 Reputation points
2021-09-05T00:32:58.307+00:00

Hello,
I am trying to connect an Azure Resource-type SQL Server to my SQL Management studio.

In SQL Management studio i am using
type: database engine
name: .database.windows.net.1433 " plus my server name"
auth: SQL Server Auth
username: azure sql server name
password: azure sql server password

After trying to connect for about 20 sec. this pops up.
............................................................................................................
A network-related or instance-specific error occurred while establishing a connection to SQL Server.
The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
..............................................................................................................

Any help would be appreciated.

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,809 questions
{count} votes

Accepted answer
  1. Erland Sommarskog 101.8K Reputation points MVP
    2021-09-05T09:39:04.193+00:00

    name: .database.windows.net.1433 " plus my server name"

    Don't know exactly what this means, but if your server name is nisse, you should enter nisse.database.windows.net. No need to specify a port number.

    On the Options tab, you should also specify the name of the database in your server you want to connect to, unless you want to land in master. You cannot change the database while you are connected.

    If your database is serverless, keep in mind that it takes a while to start up the database, and it is perfectly normal to get this error on the first attempt, and maybe also on the second.


1 additional answer

Sort by: Most helpful
  1. YufeiShao-msft 7,061 Reputation points
    2021-09-07T03:07:58.063+00:00

    In SSMS, when you want to connect to your server, if a server listens on port 1433, to connect to a server from behind a corporate firewall, the firewall must have this port open. So we have to set firewall rule. It is important, you should check it.

    There is a way to set firewall rule:https://www.c-sharpcorner.com/article/use-sql-server-management-studio-to-connect-and-query-an-azure-sql-database/

    And there is a way to connect to Azure SQL database using SSMS:https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-ssms#query-data

    0 comments No comments