Search⌘ K
AI Features

Azure SQL and PostgreSQL

Explore how to connect to Azure SQL and PostgreSQL databases using Azure Data Studio. Understand the use of server URIs, authentication types including Azure Active Directory, and managing connections via the Azure container and PostgreSQL extension.

Connecting to Azure SQL database

Connecting to your database in Azure can be achieved in much the same way as connecting to an on-premise instance of SQL Server. The figure below shows an example of connecting to an Azure SQL Database:

For Azure, you will want to specify the Server using the fully qualified Azure URIIf you are not sure of your database URI, it can be looked-up on Microsoft’s Azure Portal., which uniquely points to your database. Next, provide an authentication type, which in this case would be either SQL Login or, more preferably, Azure Active Directory.

Azure container in ADS

You can also use the Azure container found in ADS sidebar to browse all your Azure-based servers and databases, as displayed below:

To take advantage of this Azure database browsing feature, be sure that you have first authenticated with Azure Active Directory for your current desktop session.

Connecting to PostgreSQL

Connecting to PostgreSQL is very similar to connecting with SQL Server (whether on-prem or in the cloud). Be sure to first install the PostgreSQL extension from Microsoft. You can find this extension by entering “postgres” in the Extensions Marketplace control, as shown below:

A sample connection definition for PostgreSQL is illustrated below:

You will want to use the connection type of PostgreSQL. Note that this connection type (directly to PostgreSQL) only allows for Username/Password authentication. You could alternatively browse your PostgreSQL servers and databases via the previously mentioned Azure container in ADS.