Azure Data Studio Connect To SQL Server (Easy Steps)

Azure Data Studio Connect To SQL Server

This Azure article will discuss how to connect to SQL server from Azure Data Studio. Along with that, we will also discuss a few other topics.

Azure Data Studio Connect To SQL Server

Before starting the actual topic, let’s discuss the prerequisites needed here.

Prerequisites

Below are the prerequisites needed here.

  1. You must have an Azure subscription or account. If you don’t have an Azure account, you needn’t worry- you can create a free Azure account now.
  2. You must download and install Azure Data Studio on your PC.
  3. Install SQL Server Management Studio’s latest version on your machine.

Assuming you are ready with all the prerequisites needed here, let’s start with the steps needed to connect to the SQL server from Azure Data Studio.

  1. Launch Azure Data Studio on your PC.
  2. Click on the New dropdown –> Then click on the New Connection option, or click the Create a Connection button.
azure data studio connect to sql server

3. On the Connection window, provide the below details

  • Connection type: Choose the Connection type as Microsoft SQL server.
  • Select the Parameters radio button.
  • Server: Provide the Server name.
  • Authentication type: Choose the authentication type and the other details based on the authentication type.

Finally, click on the Connect button.

azure data studio cannot connect to sql server

Note: To get the server name and authentication details, open the SQL server management studio, and on the Connect to server pop-up, you will get all the details.

azure data studio connection error

Now, you can see that we can connect the Azure Data Studio to the SQL server successfully without any issues.

azure data studio connection error

How to connect Azure Data Studio to Azure SQL

Similarly, we can connect Azure Data Studio to Azure SQL using the below steps. Check out How to create an Azure SQL database if you have not yet created your Azure SQL database.

  1. Follow steps 1 and 2 from the above section.
  2. On the Connection window, provide the below details.
  • Connection type: Choose the connection type as SQL server.
  • Choose the Parameters option.
  • Server: Specify the server name of your Azure SQL. You will get the server name by navigating to the Azure SQL database in the Azure POrtal. Refer to the below note.
  • Authentication type: Choose SQL Login as the authentication type.
  • Username and Password: Specify the Username and password you specified during the Azure SQL database creation in the Azure Portal.
  • Finally, click on the Connect button.
how to connect Azure data studio to Azure SQL

Note: Navigate to the Azure SQL database in the Azure Portal and click on the Copy to Clipboard button next to the server name to copy the server name.

azure data studio connect to sql server

You might get the below connection error after clicking the Connect button.

“Reason: An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes (https://docs.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://docs.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database).”

You can see it here

An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes

To fix this error, you need to follow the below quick steps.

Public access to your Azure SQL database is disabled by default. To enable it, follow these steps.

  1. Navigate to the Azure SQL database in the Azure Portal and click on the server name.
Connection was denied since Deny Public Network Access is set to Yes

2. Click on the Networking link from the left navigation on the SQL Server page.

An instance-specific error occurred while establishing a connection to SQL Server

3. Select the Selected Networks option for Public network access –> then click the Save button to save the changes.

An instance-specific error occurred while establishing a connection to SQL Server.

4. Now, navigate to the Azure Data Studio and click the OK button on the error pop-up. Finally, click on the Connection button; this time, you won’t get any error and will move to the next screen.

Click the Add an Account dropdown and then the Add an Account option.

Connect Azure Data Studio and Azure SQL

5. Login with your Azure credentials and click the OK button on the next pop-up.

Connection between Azure Data Studio and Azure SQL

6. Now, we can connect the Azure Data Studio with Azure SQL DB successfully.

How to Connect Azure Data Studio and Azure SQL database

You may also like following the articles below

Wrapping Up

This article discussed how to connect Azure Data Studio to the SQL server and Azure SQL database. Thanks for reading this article. I hope it helps !!!