Azure Data Studio is a cross-platform database tool that allows you to run SQL Server, Azure SQL Database, PostgreSQL, Jupyter Notebooks, and more on Windows, macOS, and Linux. It gives you the ability to quickly chart and visualize results sets. Azure Data Studio is also good if you do not require the wizard experience and just need to do normal administrative configurations
- SQL code editor with IntelliSense and built-in multiple tab windows.
- Smart SQL code snippets that generate correct SQL syntax to create databases.
- Customizable Server and Database Dashboards to monitor and quickly troubleshoot performance.
- Server groups that provide a way to organize server connections.
- Integrated terminal like Bash and PowerShell.
- Localized in 10 different languages.
In this guide, I will show you how to install Azure Data Studio on KDE Neon|Kubuntu.
Install Azure Data Studio on KDE Neon / Kubuntu
You can install Azure Data Studio using the .deb package file or the tar.gz package file both at the Azure Data Studio Downloads page.
Update your System packages
### Kubuntu ### sudo apt update && sudo apt upgrade -y ### KDE Neon ### sudo apt update && sudo pkcon update -y
Install with a .deb package file
Install missing dependencies using the following command.
sudo apt install libunwind8
Download the file using the following command.
wget https://go.microsoft.com/fwlink/?linkid=2187522 -O azuredatastudio.deb
Install the file using the following command
sudo dpkg -i azuredatastudio.deb
Run Azure Data studio using the following command
Install with a tar.gz file
Install missing dependencies using the following command.
sudo apt-get install libxss1 libgconf-2-4 libunwind8
Download the file using the following command
wget https://go.microsoft.com/fwlink/?linkid=2187462 -O azuredatastudio.tar.gz
Extract the file using the following command
tar -xvf ~/azuredatastudio.tar.gz echo 'export PATH="$PATH:~/azuredatastudio-linux-x64"' >> ~/.bashrc source ~/.bashrc
Launch Azure Data Studio on KDE Neon|Kubuntu
To start Azure Data studio run the following command.
Once launched, The application opens.
You can also see it has extensions built-in and ready for installation.
Configure Azure Data Studio to Connect to SQL Server
To create a connection, you should have SQL Server installed on your system. If not, follow through to install it
Install SQL Server on KDE Neon / Kubuntu
Import the official GPG key to the repositoty,
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Register the Microsoft SQL Server Ubuntu repository for SQL Server 2019
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
Run the following commands to install SQL Server
sudo apt update sudo apt install -y mssql-server
Then configure the SQL server using the prompts after running the follwoin command.
$ sudo /opt/mssql/bin/mssql-conf setup ###Output Choose an edition of SQL Server: 1) Evaluation (free, no production use rights, 180-day limit) 2) Developer (free, no production use rights) 3) Express (free) 4) Web (PAID) 5) Standard (PAID) 6) Enterprise (PAID) - CPU Core utilization restricted to 20 physical/40 hyperthreaded 7) Enterprise Core (PAID) - CPU Core utilization up to Operating System Maximum 8) I bought a license through a retail sales channel and have a product key to enter. Details about editions can be found at https://go.microsoft.com/fwlink/?LinkId=2109348&clcid=0x409 Use of PAID editions of this software requires separate licensing through a Microsoft Volume Licensing program. By choosing a PAID edition, you are verifying that you have the appropriate number of licenses in place to install and run this software. Enter your edition(1-8): 3 The license terms for this product can be found in /usr/share/doc/mssql-server or downloaded from: https://go.microsoft.com/fwlink/?LinkId=2104294&clcid=0x409 The privacy statement can be viewed at: https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409 Do you accept the license terms? [Yes/No]:yes Enter the SQL Server system administrator password: Confirm the SQL Server system administrator password: Configuring SQL Server... The licensing PID was successfully processed. The new edition is [Express Edition]. ForceFlush is enabled for this instance. ForceFlush feature is enabled for log durability. Created symlink /etc/systemd/system/multi-user.target.wants/mssql-server.service → /lib/systemd/system/mssql-server.service. Setup has completed successfully. SQL Server is now starting.
Veify server is running by using the following command.
$ systemctl status mssql-server --no-pager ###Output ● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2022-04-11 14:49:42 EAT; 2min 18s ago Docs: https://docs.microsoft.com/en-us/sql/linux Main PID: 23014 (sqlservr) Tasks: 121 Memory: 867.5M CGroup: /system.slice/mssql-server.service ├─23014 /opt/mssql/bin/sqlservr └─23036 /opt/mssql/bin/sqlservr
Create a connection of Azure Data Studio with SQL Server
Now go back to azure data studio and click on Create Connection. Enter your details as the ones you have configured above and click on Connect.
Once the connection is succesful, you will see a similar window like below.
Create a Database
Click on ‘New Query‘ to open a new tab window. Then paste the following to the window and click Run.
USE master GO IF NOT EXISTS ( SELECT name FROM sys.databases WHERE name = N'TutorialDB' ) CREATE DATABASE [TutorialDB]; GO IF SERVERPROPERTY('ProductVersion') > '12' ALTER DATABASE [TutorialDB] SET QUERY_STORE=ON; GO
You will see a new database named TutorialDB appear. If not right-click on database option then refresh.
Create a Table
Now lets create a table for or database. Paste this code in the query window and ensure that TutorialDB is selected under the dropdown menu. Click Run.
-- Create a new table called 'Customers' in schema 'dbo' -- Drop the table if it already exists IF OBJECT_ID('dbo.Customers', 'U') IS NOT NULL DROP TABLE dbo.Customers; GO -- Create the table in the specified schema CREATE TABLE dbo.Customers ( CustomerId int NOT NULL PRIMARY KEY, -- primary key column Name nvarchar(50) NOT NULL, Location nvarchar(50) NOT NULL, Email nvarchar(50) NOT NULL ); GO
The table dbo.customers appears as shown.
Now lets insert data into our table. paste this code on the query window.
-- Insert rows into table 'Customers' INSERT INTO dbo.Customers ([CustomerId], [Name], [Location], [Email]) VALUES ( 1, N'Peter', N'Australia', N'[email protected]'), ( 2, N'Keith', N'India', N'[email protected]'), ( 3, N'Donna', N'Germany', N'[email protected]'), ( 4, N'Janet', N'United States', N'[email protected]') GO
Now to view the data, paste the follwoing code and click run.
-- Select rows from table 'Customers' SELECT * FROM dbo.Customers;
The data appears as shown below.
And thats it, You have successfully created a database with Azure Data studio connected to a local SQL server.
We have installed Azure Data Studio on KDE Neon|Kubuntu. We have also manged to create a connection to a local SQL server and created a database. Azure data studio is a good data tool that allows you to work with SQL Server, Azure SQL DB, and SQL DW on Windows, Linux, and macOS. It is easy to use as it does not require the wizard experience or the deep knowledge of database configurations.