Wednesday, October 23, 2024
HomeHow ToWhat Is Azure Data Studio and How to Get Started with It?

What Is Azure Data Studio and How to Get Started with It?

Azure Data Studio is one of the best-known and most popular solutions for database specialists who work with local and cloud platforms on Windows, macOS, and Linux. This product is a lightweight modern environment for SQL code development with numerous embedded features. Its goal is to simplify the users’ daily tasks and continually improve their professional experience.

The overview of Azure Data Studio features

If you consider whether Azure Data Studio can replace the default SSMS product, at this moment, this is hardly the case. SSMS is more functional. Still, in some respects, Azure Data Studio, formerly known as SQL Operations Studio, is superior. So, to be on the safe side, you can get familiar with a comprehensive comparison of Azure Data Studio and SSMS to identify the strengths and weaknesses of both tools.

The primary benefit of Azure Data Studio is its cross-platform nature as you can run it on other platforms besides Windows OS.

What’s more, even though the name contains “Azure”, this does not necessarily mean that it is suitable for Azure products only. That is just one of the available options. Azure Data Studio connects to SQL Server 2014 and higher, PostgreSQL Servers, and, of course, Azure products, such as Azure SQL Database, Azure SQL Data Warehouse, and Azure SQL Managed Instance.

Smart code snippets help you create database copies for testing and development and execute the CREATE and INSERT scenarios. Convenient navigation options make code management faster and easier.

You get all the required options for writing and executing SQL queries and analyzing their work and result. You can save the results in TXT, JSON, and Excel formats to refer to them afterwards.

Additionally, you get to edit data, manage connections to the databases, and view database objects. Another excellent feature within Azure Data Studio is the possibility to use notebooks and write SQL, Spark, Python, and Scala scripts in them. 

The solution has a rich query editor, based on IntelliSense (more about it later). SQL code snippets make a convenient background to ensure correct SQL syntax for databases and such objects as tables, views, stored procedures, users, roles, etc. It also ensures all the existing database objects’ updating.

It is also worth mentioning some other helpful Azure Data Studio features, apart from those named above:

  • Source Control. Azure Data Studio includes an in-built Git Source Control Manager (SCM). With its help, you can store the database scripts, compare versions of objects, commit changes, and roll them back from Azure Data Studio.
  • Custom Insights and Dashboards. It is the option used for displaying all the necessary statistics in one place. Users can check all actual data in a visual form to detect and troubleshoot issues quickly. 
  • Checking database object definitions. To do this within SSMS, you would need some add-ins. Azure Data Studio provides the information directly.
  • Fast query results visualization. The product provides a brief overview of the data returned by a query for quick profiling.
  • Dark Theme. The feature might seem secondary, but it helps developers, by letting them view and manage data more conveniently.

In general, Azure Data Studio is the best choice if you:

  • work in a non-Windows environment;
  • mostly edit or execute queries;
  • perform most administration tasks via the embedded terminal with sqlcmd or PowerShell;
  • need to create database diagrams quickly or visualize the result sets;
  • have no need to use the wizards frequently;
  • don’t deal with precise and detailed configuration processes;
  • don’t manage security issues. 

Install Azure Data Studio

Currently, Microsoft Azure Data Studio is supported on Windows 7 and 64-bit Windows 8, 8.1, 10, as well as on Windows Server 2008 R2, 2012, 2012 R2 (all 64-bit versions), and Windows Server 2016 and 2019. Azure Data Studio is compatible with macOS 10.12 – 10.15, Linux Red Hat Enterprise 7.3, 7.4, and Ubuntu 16.04.

If you consider using this product, and you are a Windows user and have SQL Server Management Studio (SSMS) installed, it is likely that you already have Azure Data Studio installed.

The thing is, Azure Data Studio is included in the SQL Server Management Studio package since the SSMS version 18.7. It comes automatically alongside the SSMS installation. The products are both Microsoft’s creations, so putting them together is only natural.

Opening Microsoft Azure Data Studio within SSMS

Img. 1. Azure Data Studio in SSMS

Installation process

If you don’t have Azure Data Studio yet, you can download and install it for free. Downloads are available in several formats and for all OS on the official page. You only need to choose the package matching your needs and preferences. 

In this article, we are going to focus on how to install Azure Data Studio on Windows. The instructions are present on the official pages.

For Windows OS, we’d recommend the User Installer as it is the simplest way of installing and updating the software. It does not require the administrator’s rights. However, you can choose another option if it suits you better. 

Download the installation file and execute it, and then follow the installation wizard. The process is pretty simple: just click Next to proceed.

Setting up Azure Data Studio

Img. 2. Installing ADS

It shows the default folder where it installs Azure Data Studio. If you selected the User Installer option, it would suggest a different folder to install without the admin’s rights. However, here it depends on your particular conditions and configurations. 

The installation location of MS Azure Data Studio

Img. 3. The path to install

When the process is complete, click Finish

The ADS setup has finished

Img. 4. ADS is installed

There is another way to install Azure Data Studio. You can use the command-line script. It does not require any GUI prompts, and you can install the software in the background. The method is suitable for Windows platforms only.

To apply this method, launch the command prompt with elevated permissions and type the below command:

<path where the azuredatastudio-windows-user-setup-x.xx.x.exe file is located> /VERYSILENT /MERGETASKS=!runcode>
Installing Azure Data Studio with a command-line script

Img. 5. Using the command line

Connect to SQL Server and view the options 

After successful completion of the process, launch Azure Data Studio to configure it to meet your needs.

1. On the Welcome page, establish a connection with the server. For that, click New Connection:

Establishing the connection to Microsoft SQL Server

Img. 6. The Welcome page with the option to establish the connection

2. Then, provide the necessary details to connect the development environment to your SQL Server: 

  • Connection type: Microsoft SQL Server
  • Server: Enter the Server name here. For example, localhost.
  • Authentication Type: SQL Login
  • User name: User name for the SQL Server
  • Password: Password for the User name
  • Database: Database name for the SQL Server
  • Server Group: The necessary server group

After that, you can start your work and perform the required database tasks, such as create databases and tables, write queries, view the execution results, etc.

Pay attention to the left sidebar that offers shortcuts to the most useful features of the Azure Data Studio:

Basic Azure Data Studio features

Img. 7. Sidebar with shortcuts to features

1 – Connections. The feature is similar to the Object Explorer in SSMS and lets users manage existing connections and establish new connections to SQL Server. It also allows you to view the databases and objects.

2 – Search. The option lets users search for some particular phrase within all the files and folders available.

3 – Notebooks. As we mentioned earlier, notebooks contain code elements, including custom code fragments. Users can also add other elements to these areas (programs, images, etc.). 

4 – Explorer. The feature allows managing the applicable files within the tool.

5 – Source Control. Here, users can connect to Git repositories and perform standard tasks from within the Studio.

6 – Extensions. The feature lets you enhance the Azure Data Studio functionality with Extensions. In particular, it refers to coding and visualizing tasks.

Of course, these features aren’t the only ones available. Numerous configuration options are provided in the Settings section. The shortcut is the standard configure icon located in the left bottom corner of the Azure Data Studio window.

Transact-SQL Editor 

Many Azure Data Studio users distinguish the Transact-SQL editor separately. If you are focused on writing code primarily, this editor could be the most essential feature of this package.  

Transact-SQL editor offers the following options: 

  • search for the database objects;
  • perform common tasks to database objects;
  • edit table data;
  • code snippets for writing T-SQL quickly;
  • view the database object details with Peek Definition and Go to Definition;
  • search and replace;
  • hide code fragments;
  • copy lines;
  • move code lines;
  • edit multiple lines;
  • change font types and sizes;
  • color themes for customization;
  • line numbers;
  • comments.

The editor opens when you open one of the connected databases. Alternatively, it opens directly in the project by selecting the View Code option in the context menu. Another case is when it opens automatically with the start of writing queries in the SQL Server Object Explorer, or when you add a new object to the database project.

Transact-SQL editor in Microsoft Azure Data Studio

Img. 8. The editor window with the suggestion

In the main T-SQL area, users can write and edit the Transact-SQL scripts. A significant advantage of this editor is using IntelliSense. For Azure Data Studio, the IntelliSense method simplifies the code entry tasks with auto-completion and many other automated operations for checking and formatting code. This way, you save a lot of time when writing code as all operations become faster and more precise.

Using extensions for Azure Data Studio

Even though the basic functionality of Azure Data Studio is impressive, users can enhance and adjust it to their needs with the help of extensions.

The tool contains a great library of ready extensions. Many of them are developed by the Azure Data Studio team. Others are created and added by third-party developers. This product is open-source, and a great community works on improving its features.

View the installed extensions 

Azure Data Studio includes the list of default extensions provided with the installation. To check them in your instance of the product, navigate to the Command Palette or the More Actions (…) menu. 

The system of filters helps you manage extensions in your Azure Data Studio copy. To view the already installed extensions, apply the @installed filter by entering it into the search box at the top.

Viewing the installed extensions in MS Azure Data Studio

Img. 9. View all the extensions already installed

Note: You can check the list of available filters and commands by entering @ into the search field of the Extensions section.

Add an extension 

If you want to add other extensions for your personal needs, navigate to the Extensions section in the View menu, or click the Extensions icon. There, you will get a list of available extensions. For quick access, you might use the keyboard shortcuts:

Ctrl+Shift+X (Windows/Linux) or Command+Shift+X (Mac) serve to launch the extensions manager.

Select the one that you need and click Install.

Installation of a new extension within MS ADS

Img. 10. Install a new extension

To explore the available extensions, apply the filters again. The @category filter will offer you the list of available extension categories, such as themes, formatters, or snippets. When you define the category, it will filter the extensions matching that category.

Filtering the existing extensions by category in Azure Data Studio

Img. 11. Filtering the extensions by category

As soon as this process is complete, restart MS Azure Data Studio to enable the new functionality (you only need it when you get this or that extension for the first time). 

Note: The full collection of extensions is present on the product’s GitHub Wiki. If, for some reason,  you can’t access the extensions from within your Azure Data Studio, download them from GitHub.

The Azure Data Studio extensions at GitHub Wiki

Img. 12. The extensions at GitHub Wiki

Also, it is important to mention that the extensions aren’t unified, especially those added by third-party developers. Check the documentation for individual extensions to clarify how you should access them to use their functionality.

Remove an extension: disable or delete

In case you no longer need an extension, you may disable it temporarily or delete it permanently.

If you prefer to disable it, it is possible for all sessions or the current Workspace only. The commands are available in the Command Palette:

Disabling all installed extensions in Microsoft ADS

Img. 13 Menu options for disabling the extensions

All the disabled extensions get into a separate section, marked respectively. There, you can re-enable any of them when you need them back. There is also an option you can use to enable all disabled extensions in bulk.

Enabling the extensions in Microsoft Azure Data Studio

Img. 14. Menu options for enabling the extensions

To uninstall any extension permanently, click the gear icon next to a particular extension and select Uninstall from the menu. If you do it, the piece will be removed permanently, and you’ll have to install it anew, should you wish it back.

Uninstalling the extension in Azure Data Studio

Img. 15 Uninstalling the extension

Conclusion 

Ever since Azure Data Studio became generally available in 2018, it has undergone constant improvement. Microsoft invests significantly in it. Even though it can’t serve as a complete substitute for SSMS at the current stage, it might become one in the future as the developer obviously has big plans for this tool.

RELATED ARTICLES

Whitepaper

Social

Topics

Products