Open In App

How to Install SQL Server on Azure VM?

Microsoft Azure provides us with multiple database services which help us to run popular relational database management systems, like MySQL, SQL Server, and PostgreSQL in the cloud. We can use an SQL server on Azure Virtual machines by running a virtual machine in Azure and installing an SQL server in it. Each instance can support multiple different databases. By using virtual machines we make it an infrastructure-as-a-service ( IaaS) solution that virtualizes the hardware infrastructure for networking, and compute storage in Azure. SQL Server is fully compatible with on-premises physical and virtualized installations. This makes this a great option available for “lift and shift” migration of existing on-premises SQL server installations to the cloud with ease without making any changes as it effectively replicates the database running on real on-premises hardware. It is similar to moving the database from one on-premises server to another. As it is an IaaS service we must manage all the aspects of the server including the updates, configurations, operating system, backups, and other maintenance tasks of the resource. 
It has an availability of 99.99%  and can be used to develop and test traditional SQL server applications. 

Installing SQL Server on Azure VM

Prerequisites: You need to have an active Azure Subscription. You can avail a free 12-month subscription by going to the official website



Step 1: Navigate to Azure Portal and sign in to your account. 

 

Step 2: On the homepage, select All services and type in Azure SQL in the search box. 



 

Step 3: Select the +Create option present. A select SQL deployment options page will pop up. We can view the additional information by selecting show details on the SQL virtual machines tile.

 

Step 4: Select the image you wish to create. For now, you may select the Free SQL Server License: SQL Server 2019 Developer on Windows Server 2022 image from the dropdown. 

 

Step 5: Select Create to create the image. You will be promoted to provide basic details to create the image: 

Step 6: Under the administrator account, give a unique username and a password. The password should be at least 12 characters long and meet the defined complexity requirements. Inbound port rules: Choose allow selected ports and select the ports from the drop-down. For now, choose RDP(3389)

 

Step 7: Next, click on SQL server settings. In the tab that opens fill in the necessary details : 

 

Step 8: On the Review + Create tab, review the summary and select Create to create the SQL server, resource group, and resources specified for the VM with the specified configurations. 

 

Step 9: If it shows all validations passed them click on create button to create your virtual machine else check for validation errors. It will take some time to get deployed.

 

Connecting to the SQL server

Step 1: Go to the deployed resource in the portal. In the overview section of the virtual machine you had created you will find a public IP address. Note it down.

 

Step 2: On a different computer from where you wish to connect open SQL Server Management Studio. A connect to server or connect to database engine dialog box will pop up. Enter the public IP address we had previously noted down in the Server name. Then add a comma and add the custom port that we used when configuring the virtual machine (1418). For example, 31.22.43.11,1418. In the authentication box, select the SQL server authentication. You will be asked to log in. Type the name of the SQL login and login password. 

 

Step 3: Click on the connect button then you will connect to your SQL server. 

 

The capabilities of the SQL Server on Azure help us to:

Article Tags :