How to Install SQL Server on Azure VM?
Last Updated :
30 Mar, 2023
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:
- Subscription: Choose the Azure subscription in which you wish to create the image.
- Resource group: Choose the resource group where you wish to create the image of creating a new resource group.
- Virtual machine name: Enter a unique name for the virtual machine name.
- Region: Choose a location
- Availability options: Choose the option based on your needs. For now, select No infrastructure redundancy required.
- Image list: Select the image. For now select Free SQL Server License: SQL Server 2019 Developer on Windows Server 2022.
- Size: Select the size you wish for the virtual machine. For now, select the A2 basic offering by clicking on change size.
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 :
- Under security and networking, select Public for SQL connectivity and make the port 1418 to avoid a well-known port number in the public scenario.
- Under SQL authentication, choose whether you wish to enable it or not. For now, click on Enable. The SQL login credentials will be the same as the user name and password we configured for our VM.
- Change any other if needed and click on Review + Create.
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:
- Instantly create development and test scenarios for our applications when we don't want to buy on-premises development or test SQL server hardware.
- It makes it a great fit for a lift-and-shift fast migration of existing applications with minimal or no changes.
- Be cost-effective and efficient as it helps us scale up the platform in which the SQL Server is running by allocating more resources (memory, CPU power, disk space) to our virtual machines. We can quickly resize the virtual machine without even reinstalling the software that is running on it.
- It allows us to extend existing on-premises applications to the cloud in hybrid mode.
- It allows us to have full administration over the DBMS and operating system of the virtual machine.
Similar Reads
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi
6 min read
What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
13 min read
Python Variables In Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i
6 min read
Spring Boot Interview Questions and Answers Spring Boot is a Java-based framework used to develop stand-alone, production-ready applications with minimal configuration. Introduced by Pivotal in 2014, it simplifies the development of Spring applications by offering embedded servers, auto-configuration, and fast startup. Many top companies, inc
15+ min read