title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | ms.custom |
---|---|---|---|---|---|---|---|---|---|
Create SQL Server VM using an ARM template |
Learn how to create a SQL Server on Azure Virtual Machine (VM) by using an Azure Resource Manager template (ARM template). |
bluefooted |
pamela |
mathoma |
06/29/2020 |
azure-vm-sql-server |
deployment |
quickstart |
subject-armqs, mode-arm, devx-track-arm-template |
Use this Azure Resource Manager template (ARM template) to deploy a SQL Server on Azure Virtual Machine (VM).
[!INCLUDE About Azure Resource Manager]
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.
The SQL Server VM ARM template requires the following:
- The latest version of the Azure CLI and/or PowerShell.
- A preconfigured resource group with a prepared virtual network and subnet.
- An Azure subscription. If you don't have one, create a free account before you begin.
The template used in this quickstart is from Azure Quickstart Templates.
:::code language="json" source="~/../quickstart-templates/quickstarts/microsoft.sqlvirtualmachine/sql-vm-new-storage/azuredeploy.json":::
Five Azure resources are defined in the template:
- Microsoft.Network/publicIpAddresses: Creates a public IP address.
- Microsoft.Network/networkSecurityGroups: Creates a network security group.
- Microsoft.Network/networkInterfaces: Configures the network interface.
- Microsoft.Compute/virtualMachines: Creates a virtual machine in Azure.
- Microsoft.SqlVirtualMachine/SqlVirtualMachines: registers the virtual machine with the SQL IaaS Agent extension.
More SQL Server on Azure VM templates can be found in the quickstart template gallery.
-
Select the following image to sign in to Azure and open a template. The template creates a virtual machine with the intended SQL Server version installed to it, and registered with the SQL IaaS Agent extension.
-
Select or enter the following values.
- Subscription: Select an Azure subscription.
- Resource group: The prepared resource group for your SQL Server VM.
- Region: Select a region. For example, Central US.
- Virtual Machine Name: Enter a name for SQL Server virtual machine.
- Virtual Machine Size: Choose the appropriate size for your virtual machine from the drop-down.
- Existing Virtual Network Name: Enter the name of the prepared virtual network for your SQL Server VM.
- Existing Vnet Resource Group: Enter the resource group where your virtual network was prepared.
- Existing Subnet Name: The name of your prepared subnet.
- Image Offer: Choose the SQL Server and Windows Server image that best suits your business needs.
- SQL Sku: Choose the edition of SQL Server SKU that best suits your business needs.
- Admin Username: The username for the administrator of the virtual machine.
- Admin Password: The password used by the VM administrator account.
- Storage Workload Type: The type of storage for the workload that best matches your business.
- Sql Data Disks Count: The number of disks SQL Server uses for data files.
- Data Path: The path for the SQL Server data files.
- Sql Log Disks Count: The number of disks SQL Server uses for log files.
- Log Path: The path for the SQL Server log files.
- Location: The location for all of the resources, this value should remain the default of
[resourceGroup().location]
.
-
Select Review + create. After the SQL Server VM has been deployed successfully, you get a notification.
The Azure portal is used to deploy the template. In addition to the Azure portal, you can also use Azure PowerShell, the Azure CLI, and REST API. To learn other deployment methods, see Deploy templates.
You can use the Azure CLI to check deployed resources.
echo "Enter the resource group where your SQL Server VM exists:" &&
read resourcegroupName &&
az resource list --resource-group $resourcegroupName
When no longer needed, delete the resource group by using Azure CLI or Azure PowerShell:
echo "Enter the Resource Group name:" &&
read resourceGroupName &&
az group delete --name $resourceGroupName &&
echo "Press [ENTER] to continue ..."
$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name"
Remove-AzResourceGroup -Name $resourceGroupName
Write-Host "Press [ENTER] to continue..."
For a step-by-step tutorial that guides you through the process of creating a template, see:
[!div class="nextstepaction"] Tutorial: Create and deploy your first ARM template
For other ways to deploy a SQL Server VM, see:
To learn more, see an overview of SQL Server on Azure VMs.