In this post I want to cover an interesting Windows Container with SQL Server installed experiment that I did. Because it was fairly involved, and it took a while.
In fact, this is the experiment I was talking about in my recent post about recent Azure Data Studio updates. Which you can read about in detail here.
Windows Container with SQL Server installed
For those of you who are not aware of it yet, you can download a Windows container with SQL Server 2017 Developer Edition installed. Which you can read about in detail here.
My main reason for doing this experiment was just to see if it could be done. However, I should stress that I do prefer to use Linux containers with SQL Server installed.
Change Docker to support Windows Containers
In order to start deploying this image I first had to change Docker Desktop to support Windows containers. Because by default Docker Desktop supports Linux containers.
I decided to do this the easy way, by right clicking the Docker icon and changing to use Windows containers.
Create Windows container using Azure Data Studio
After I had changed Docker Desktop to support windows containers I opened Azure Data Studio. From there I opened up the wizard to create a SQL Server container image.
I then completed the wizard to generate the notebook. Afterwards, I started the cells until I got to the ‘Pull the container image’ section.
Before running that cell, I went to the Microsoft Container registry site for the Windows container with SQL Server Developer Edition installed. Which you can find yourself here.
I copied the pull command location shown on that site and replaced the image in the ‘Pull the container image’ section of the notebook with it.
First time around it appeared to be taking a long time. So, I decided to cancel it and run the docker pull command in PowerShell, just to check it worked.
It did work; however, it did take longer than expected. Maybe it was because of the size of it, or another issue.
Once that was done I was able to run the ‘Pull the container image’ cell fairly quick. Because the image was already in the Docker cache because I had run the pull command in PowerShell.
Afterwards, I had to change the image name again in the ‘Start a new container’ cell to the one that I had copied. So that it would start the right windows container image.
Connecting to the SQL Server instance
Finally, I went to connect to the instance in the ‘Connect to SQL Server in Azure Data Studio’ cell. However, it did not work as I expected when I first tried it.
With this in mind to the SQL Server instance within the container using SQL Server Management Studio. Just so that I knew that the container was working OK.
Once I had confirmed this I closed Azure Data Studio and then reopened it to go back to the Notebook that the wizard had created to try connecting again.
Because I had closed Azure Data Studio I had to manually enter the password and port details again in when I ran the ‘Required information’ cell.
After doing this I scrolled down to the ‘Connect to SQL Server in Azure’ cell. However, I still could not connect because it was reporting a timeout error.
So, in the ‘Connection Details’ section I clicked the ‘Advanced’ button and then changed the timeout setting to 60 seconds. After I had done this it finally worked I was able to view the SQL Server instance in Azure Data Studio.
Result of Windows Container experiment
So, basically you can use the notebook generated by the wizard in Azure Data Studio to create a Windows container that is running SQL Server. However, you do have to remember to make some changes to make this work.
Final words about Windows Container with SQL Server experiment
I hope you enjoyed reading about this interesting Windows Container with SQL Server experiment that I did.
I was tempted to submit some feedback to the Azure Data Studio team. However, I’m not sure how much of a demand there is at the moment for the ability to install Windows containers running SQL Server.
Mostly due to the popularity of deploying Linux containers running SQL Server. However, if you are interested in using Windows containers feel free to leave a comment. Because I will submit the feedback if I think there is enough demand for it.