Installation & working SQL Developer edition of Azure on Windows using Docker & Azure Data Studio

Installation & working SQL Developer edition of Azure on Windows using Docker & Azure Data Studio

Introduction :

This article helps you to have a quick start with docker, usage of Azure Data storage with SQL developer edition which is part of the Ubuntu container.

Azure Data Studio :

This is a free cross-platform IDE from Microsoft that helps to work with your databases & data warehouses with the full support of code snippets, external extensions, and Source control integration.

Docker:

It is container-based virtualization support for the operating systems. This implies that the very app that you want to deploy in the production or want to work in the development and its dependencies would be embedded as a single isolated process and is away from interfering with the business of operating systems and apps in the other containers, which can also likely be the same app of a different version.

SQL Developer Edition :

The most popular edition of SQL server helps us to create/do most of the database-specific operations. The reason I used a Ubuntu SQL image on azure is it's free or at a minimal cost. The details of the registry are specified in the Installations section.

Pre-Requisites:

The following are the installations that have to be available, if not please use the links to download it

  1. Docker
  2. Azure Data Studio

Configuring/creating the resource in the Azure portal

  1. Use the link to create the ntegralic image it's a preconfigured image. https://portal.azure.com/#create/ntegralinc1586961136942.ntegral_ubuntu18_04_sql_developer_1_0_ga
  2. Create the resource using Basic operation
  3. Once the image is created, please keep the following items noted

No alt text provided for this image

4. Please note the docker image pull command of the created resource, this can be accessed by clicking the Repositories on the side blade of the provisioned resource

No alt text provided for this image

The docker image

Navigate to the command line or your docker terminal, follow the below commands in the order

  1. Connect to Azure

az login
az acr login --name <registryname>        

Note: The registry name would be available from the AccessKeys blade of the created image in Azure

2. Pull the docker image to your local machine

docker pull <imagedetails>        

3. use the following command to start the docker container (Container is term coined for instance of the image). Also note that docker uses a term called tag - used to identify the specific instance of the image

docker run -e 'INIT_PASSWORD=HelloPassword_01' -p 1433:1433 --name SU2 -h SU2 -d <servername>.azurecr.io/ntegralinc<ID>/ubuntu18-04-sql-developer:latest        

Inputs

  • INIT_Password The password of the sa account (note: It is not SA_Password like for other instances)
  • p The port number on which the instance/container has to run
  • h Refers to the hostname, for this image its optional to use since we use either localhost or the standard 127.0.0.1
  • d Refers to the detached mode, which means it would run as a background instance and you would not have an interaction shell (which here we would not require)
  • name Refers to the name of the container/instance

Output

It prints the unique Id of the container/instance if no errors.You can check the running containers using the below command

docker ps -a        

Note: Though the image is free, you might be charged for Azure Container registries, so use the docker stop and start commands to be safe on pockets

docker stop <ContainerID>/<ContainerName>        

From the above example, you can use the stop command

No alt text provided for this image
docker start <ContainerID>/<ContainerName>        
No alt text provided for this image

At any point, if the docker list command says it is exited or not running, you can use logs to check on the issue

docker logs <Containerid>/<Containername>        

Once your docker image is started, we can verify it using sqlcmd commands/SSMS (SQL Server Management Studio) or Azure Data Studio, in this example am using Azure Data Studio

Azure Data Studio

The following steps would be necessary to initiate a connection

  1. Click on Create Connection option
  2. The following should be the selections

Server - LocalHost
Authentication Type - SQL login
UserName - sa
Password - HelloPassword_10
No alt text provided for this image

Note : The password would be the same as the password used during docker Container provisioning (docker run command)

Once connected successfully, you should be able to see the default databases listed.

To work with Azure Data studio, it is recommended to use the plugin

No alt text provided for this image

Once the extension is installed, you can use, File-->new query option from the toolbar to deal with all the SQL-related operations.

Note: If you see any errors, use the docker logs or ps command to check the state of the container (started/exited). All the changes made would be affected by the container, not the actual image.

docker logs <containerID>
docker ps -a        

Here completes the setup of the tools required to start your database project in Azure with minimal cost.

To view or add a comment, sign in

More articles by Divya Akula

Others also viewed

Explore content categories