Welcome to this guide on how to install and use Azure Data Studio on Rocky Linux 8|AlmaLinux 8. Azure Data Studio initially known as SQL Azure, is a professional and cross-platform database tool using on-premises and cloud data platforms. This tool offers the best and most modern editor experience with code snippets, integrated terminal, source control integration e.t.c. It also has an in-built chart of query result sets and customizable dashboards. With Azure Data Studio, you can easily query, design, and manage your databases on local and cloud platforms.
The features associated with Azure Data Studio are well elaborated below.
- Customizable Server and Database Dashboards: It allows one to get rich customizable dashboards that help monitor and troubleshoot performance issues.
- Connection management: the server groups provide the easiest way to manage connection information for a given server and databases
- Integrated Terminal: this allows one to use tools such as PowerShell, Bash, bcp, sqlcmd and ssh within the Azure Data Studio.
- Extensibility and extension authoring: Azure Data Studio functionality can be enhanced through extensions.
- Smart SQL code snippets: Codes with the proper syntax to create databases, views, tables, stored procedures, logins, users, and roles are generated with the SQL code snippets.
- SQL code editor with IntelliSense: It offers the most modern editor with keyword completion, source control integration, code navigation, multiple tab windows e.t.c
Let’s dive in!
System Requirements:
For this setup, you need a system with the following specifications:
- Memory – 4GB (recommended 8GB)
- CPU cores – 2 (recommended 4)
#1. Download Azure Data Studio
The latest general availability(GA) version 1.35.1 for Azure Data Studio was released on March 17, 2022. There are two methods one can use to install the Azure Data Studio on Rocky Linux 8|AlmaLinux 8. These are:
- Using an RPM file
- Using Linux tar.gz file
This guide demonstrates how to install Azure Data Studio using both RPM and TAR.GZ files. Download the preferred file for installation as below:
##For RPM
wget https://go.microsoft.com/fwlink/?linkid=2193238 -O azuredatastudio.rpm
##FOR TAR.GZ
wget https://go.microsoft.com/fwlink/?linkid=2193237 -O azuredatastudio.tar.gz
The latest insider version build from the main can be downloaded by clicking on the below link:
- Linux TAR.GZ(insiders build)
Once the preferred file is downloaded, proceed as below.
#2. Install Azure Data Studio on Rocky Linux 8|AlmaLinux 8
Based on the downloaded file, proceed with the appropriate installation option.
Option 1 – Install Azure Data Studio using RPM file
With the RPM file downloaded, install Azure Data Studio on Rocky Linux 8|AlmaLinux 8 using the command:
sudo yum install azuredatastudio.rpm
Sample Output:
Dependencies resolved.
=======================================
Package
Arch Version
Repository Size
=======================================
Installing:
azuredatastudio
x86_64 1.36.1-1650577003.el7
@commandline 172 M
Installing dependencies:
libXScrnSaver
x86_64 1.2.3-1.el8
appstream 30 k
Transaction Summary
=======================================
Install 2 Packages
Total size: 172 M
Total download size: 30 k
Installed size: 513 M
Is this ok [y/N]: y
Option 2 – Install Azure Data Studio using TAR.GZ file
Begin by installing the required tool:
sudo yum install libXScrnSaver
Extract the downloaded .tar.gz file to /opt:
tar -xvf azuredatastudio-linux-*.tar.gz
sudo mv azuredatastudio-linux-x64 /opt/azuredatastudio
Once extracted, export the PATH variable as below:
$ sudo vi /etc/profile
export PATH="$PATH:/opt/azuredatastudio"
Source the profile:
source /etc/profile
#3. Use Azure Data Studio on Rocky Linux 8|AlmaLinux 8
Once installed with any of the methods above, launch Azure Data Studio using the command:
azuredatastudio
You can as well launch it from the App menu
The Azure Data Studio will start as below.
Once launched, connect to an SQL Server. I assume you already have one installed, otherwise use the guides below to install the Microsoft SQL Server on your system.
- Install Microsoft SQL Server on CentOS / RHEL/Rocky Linux/Alma Linux
- How to install MS SQL on Ubuntu
- How to install Microsoft SQL Server on Fedora
To connect to a database, click on “new connection“. Proceed and provide the SQL Server details as below:
On successful authentication, you should see the below page.
Create a database
Create a database by right-clicking on the server and selecting New query
Enter the below code and click run
USE master
GO
IF NOT EXISTS (
SELECT name
FROM sys.databases
WHERE name = N'TestDB'
)
CREATE DATABASE [TestDB];
GO
IF SERVERPROPERTY('ProductVersion') > '12'
ALTER DATABASE [TestDB] SET QUERY_STORE=ON;
GO
Once the code runs successfully, you will have the database appear after refreshing databases.
Create a table
To the connected database(master), we will create a table in TestDB. Switch to the created TestDB context.
Now add the below code and run it to create a table:
-- 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
After this, right-click on tables and refresh. You will have the table created in TestDB.
Insert rows
To insert rows in the created table, use the below query:
-- Insert rows into table 'Customers'
INSERT INTO dbo.Customers
([CustomerId], [Name], [Location], [Email])
VALUES
( 1, N'Orlando', N'Australia', N''),
( 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
Run the query.
View the data returned by a query
Run the following query in the query window.
-- Select rows from table 'Customers'
SELECT * FROM dbo.Customers;
Sample Output:
Voila!
We have triumphantly walked through how to install and use the Azure Data Studio on Rocky Linux 8|AlmaLinux 8. I hope this was helpful.
See more: