Quickstart: Create a SQL Server 2017 Windows virtual machine in the Azure portal
This quickstart steps through creating a SQL Server virtual machine in the Azure portal.
- This quickstart provides a path for quickly provisioning and connecting to a SQL VM. For more information about other SQL VM provisioning choices, see the Provisioning guide for Windows SQL Server VMs in the Azure portal.
- If you have questions about SQL Server virtual machines, see the Frequently Asked Questions.
Get an Azure subscription
If you don't have an Azure subscription, create a free account before you begin.
Select a SQL Server VM image
Sign in to the Azure portal using your account.
In the Azure portal, select Create a resource.
In the search field, type
SQL Server 2017 Developer on Windows Server 2016, and press ENTER. Expand the SQL Server 2017 on Windows Server 2016 option.
Select the Free SQL Server License: SQL Server 2017 Developer on Windows Server 2016 image. The Developer edition is used in this tutorial because it is a full-featured edition of SQL Server that is free for development testing purposes. You pay only for the cost of running the VM. For complete pricing considerations, see Pricing guidance for SQL Server Azure VMs.
Provide basic details
On the Basics tab, provide the following information:
In the Project Details section, select your Azure subscription and then select Create new to create a new resource group. Type SQLVM-RG for the name.
Under Instance details:
- Type SQLVM for the Virtual machine name.
- Choose a location for your Region.
- For the purpose of this quickstart, leave Availability options set to No infrastructure redundancy required. To find out more information about availability options, see Availability.
- In the Image list, select Free SQL Server License: SQL Server 2017 Developer on Windows Server 2016.
- Choose to Change size for the Size of the virtual machine and select the A2 Basic offering. Be sure to clean up your resources once you're done with them to prevent any unexpected charges.
Under Administrator account, provide a username, such as azureuser and a password. The password must be at least 12 characters long and meet the defined complexity requirements.
Under Inbound port rules, choose Allow selected ports and then select RDP (3389) from the drop-down.
SQL Server settings
On the SQL Server settings tab, configure the following options:
Under Security & Networking, select Public (Internet) for SQL Connectivity and change the port to
1401to avoid using a well-known port number in the public scenario.
Under SQL Authentication, select Enable. The SQL Login is set to the same user name and password that you configured for the VM. Use the default settings for Azure Key Vault integration and Storage configuration.
Change any other settings if needed, and then select Review + create.
Create the SQL Server VM
On the Review + create tab, review the summary, and select Create to create SQL Server, resource group, and resources specified for this VM.
You can monitor the deployment from the Azure portal. The Notifications button at the top of the screen shows basic status of the deployment. Deployment can take several minutes.
Connect to SQL Server
In the portal, find the Public IP address of your SQL Server VM in the Overview section of your virtual machine's properties.
On a different computer connected to the Internet, open SQL Server Management Studio (SSMS).
In the Connect to Server or Connect to Database Engine dialog box, edit the Server name value. Enter your VM's public IP address. Then add a comma, and add the custom port, 1401, that we specified when you configured the new VM. For example,
In the Authentication box, select SQL Server Authentication.
In the Login box, type the name of a valid SQL login.
In the Password box, type the password of the login.
Log in to the VM remotely
Use the following steps to connect to the SQL Server virtual machine with Remote Desktop:
After the Azure virtual machine is created and running, click the Virtual Machines icon in the Azure portal to view your VMs.
Click the ellipsis, ..., for your new VM.
Open the RDP file that your browser downloads for the VM.
The Remote Desktop Connection notifies you that the publisher of this remote connection cannot be identified. Click Connect to continue.
In the Windows Security dialog, click Use a different account. You might have to click More choices to see this. Specify the user name and password that you configured when you created the VM. You must add a backslash before the user name.
Click OK to connect.
After you connect to the SQL Server virtual machine, you can launch SQL Server Management Studio and connect with Windows Authentication using your local administrator credentials. If you enabled SQL Server Authentication, you can also connect with SQL Authentication using the SQL login and password you configured during provisioning.
Access to the machine enables you to directly change machine and SQL Server settings based on your requirements. For example, you could configure the firewall settings or change SQL Server configuration settings.
Clean up resources
If you do not need your SQL VM to run continually, you can avoid unnecessary charges by stopping it when not in use. You can also permanently delete all resources associated with the virtual machine by deleting its associated resource group in the portal. This permanently deletes the virtual machine as well, so use this command with care. For more information, see Manage Azure resources through portal.
In this quickstart, you created a SQL Server 2017 virtual machine in the Azure portal. To learn more about how to migrate your data to the new SQL Server, see the following article.