You are here:   Blog
Register   |  Login

Blog Archive:

* Can be used in order to search for older blogs Entries

Search in blogs

Blog Categories:

* Can be used in order to search for blogs Entries by Categories

Blog Tags:

* Can be used in order to search for blogs by keywords


Awared MVP


Microsoft® Community Contributor 

Microsoft® Community Contributor

 Read this before you use the blog! Maximize

Recent Entries


Written by: ronen ariely
13/01/2022 00:42 RssIcon

1. Open the portal

2. Open the cloud shell

Note: instead of steps 1 and 2 you can use PowerShell and connect your subscription

3. Create resource group named MyNewRS"located in east US

az group create --name MyNewRS --location eastus

4. Create virtual machine named MyVM with the template UbuntuLTS and root user name is MyUser

az vm create --resource-group MyNewRS --name MyVM --image UbuntuLTS --admin-username MyUser --generate-ssh-keys

In the result of this action you should get the publicIpAddress which you should use in order to connect the VM

5. Connect to VM using the publicIpAddress from step 4 instead of the value

ssh MyUser@

Now we can start Install SQL Server

6. Download the public repository GPG keys to current location, and register the authenticate packages key

wget -qO- https://packages.microsoft.com/keys/microsoft.asc > microsoft.asc
sudo apt-key add microsoft.asc

7. Register the Microsoft SQL Server repository for SQL Server 2019 on Ubuntu 18.04

sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"

8. install SQL Server

sudo apt-get update
sudo apt-get install -y mssql-server

9. Configure the SQL Server

sudo /opt/mssql/bin/mssql-conf setup

10. verify that the service is running

systemctl status mssql-server --no-pager

Install the SQL Server command-line tools

11. install curl

sudo apt-get update 
sudo apt install curl

12. Import the public repository GPG keys

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

13. Register the Microsoft Ubuntu repository For Ubuntu 18.04

curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

14. Install the SQL Server command-line tools

sudo apt-get update 
sudo apt-get install mssql-tools unixodbc-dev

15. Add /opt/mssql-tools/bin/ to your PATH environment variable

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc

16. Connect locally

sqlcmd -S localhost -U SA -P ''

17. Open port 1433 for remote connection

sudo ufw allow 1433/tcp

18. Open the Azure network firewall of the VM using the Azure portal


Read more