Query SQL with Azure Data Studio

Azure SQL Nov 16, 2021

The official definition of Azure Data Studio is:

Azure Data Studio is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

And it's a pretty awesome tool.  What I want to show you is how to use it to connect to an Azure SQL database and use it to query that database.

Installing Azure Data Studio

The first thing you should do install Azure Data Studio, you can find the installer here or if you use Windows Package Manager you can use the command:

winget install microsoft.azuredatastudio

Connect to your Azure SQL Database

When you open up Azure Data Studio down the left hand side you'll have a menu panel, the first option looks like a server, that is the connection area.

Click on that and you will be asked to add a connection.

A dialog box will open up on the right hand side of your screen asking for some connection details.

Azure Data Studio Connection
Azure Data Studio Connection

You will need the server name and the username and password to connect at a very basic level.  You might have to provide the database or server group information depending on your database or setup.

Once you've inputted the information hit the connect button and if you've put in the right information then you should have a live connection to the database.

Azure Data Studio Connected
Azure Data Studio Connected

You can then click on the "New Query" button to query the database for information.

Connect through the Azure Portal

If you have Azure Data Studio installed on your machine and you are in the Azure Portal, there is a button you can use to start the creation of the connection within Azure Data Studio.

Azure Portal
Azure Portal

This will fill in some of the information needed but you will have to put in some authentication details.

Call to Action

Azure Data Studio is a very good tool and can help you interact with SQL Server, Azure SQL DB and SQL DW.  Let me know what cool features or tips you've found using it, I'd love to hear your stories.


Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.