Starting with SQL Server 2017, we can run Microsoft’s enterprise-grade RDBMS on Linux. Combined with the power of the Azure Marketplace, this gives us the ability to quickly spin up database infrastructure in a minimal amount of time.
In this hands-on lab, we quickly meet business demands for database infrastructure by utilizing images in the Azure Marketplace.
Successfully complete this lab by achieving the following learning objectives:
- Log In to the Azure Portal
Log in to the Azure Portal using the provided credentials.
- Create a SQL Server on Linux VM from the Azure Marketplace
- On the home page, click Create a resource.
- Search for "SQL Server 2017" and hit enter.
- Filter the search by the criteria Operating system -> Redhat and Publisher -> Microsoft.
- Click on Free SQL Server License: SQL Server 2017 Developer on Red Hat Enterprise Linux 7.4 (RHEL).
- Click Create.
- Select the resource group created by the lab.
- Provide a Virtual machine name.
- Click Change size under Size.
- Choose "See all sizes" and scroll down to the B2s row and select it.
- Choose Password for the Authentication type, then provide a Username and Password.
- Click Allow selected ports.
- Select SSH (22).
- Click Review + create.
- Verify everything looks good and click Create.
- Once the deployment is complete, click Go to resource.
- Connect to the VM
- On the resource page, click Connect at the top.
- Use the provided information to SSH to the server.
- Change the SA Password
- Stop the
sudo systemctl stop mssql-server
- Change the SA password.
sudo /opt/mssql/bin/mssql-conf set-sa-password
- Restart the
sudo systemctl start mssql-server
- Stop the
- Allow Incoming Connections
If we’d like outside applications to connect to our database, we must follow these steps.
- On our resource page, click Networking in the left pane.
- Click Add inbound port rule.
- Leave all of the defaults, but change Destination port ranges to "1433".
- Change Name to "Port_1433".
- Click Add.
Use the following commands to open the firewall port on the VM.
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent sudo firewall-cmd --reload
Success! We’ve created a SQL Server backend that the development team can utilize with minimal time and configuration!