Microsoft.SqlVirtualMachine sqlVirtualMachines

The sqlVirtualMachines resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.SqlVirtualMachine/sqlVirtualMachines resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.SqlVirtualMachine/sqlVirtualMachines@2017-03-01-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  identity: {
    type: 'SystemAssigned'
  properties: {
    autoBackupSettings: {
      backupScheduleType: 'string'
      backupSystemDbs: bool
      enable: bool
      enableEncryption: bool
      fullBackupFrequency: 'string'
      fullBackupStartTime: int
      fullBackupWindowHours: int
      logBackupFrequency: int
      password: 'string'
      retentionPeriod: int
      storageAccessKey: 'string'
      storageAccountUrl: 'string'
    autoPatchingSettings: {
      dayOfWeek: 'string'
      enable: bool
      maintenanceWindowDuration: int
      maintenanceWindowStartingHour: int
    keyVaultCredentialSettings: {
      azureKeyVaultUrl: 'string'
      credentialName: 'string'
      enable: bool
      servicePrincipalName: 'string'
      servicePrincipalSecret: 'string'
    serverConfigurationsManagementSettings: {
      additionalFeaturesServerConfigurations: {
        isRServicesEnabled: bool
      sqlConnectivityUpdateSettings: {
        connectivityType: 'string'
        port: int
        sqlAuthUpdatePassword: 'string'
        sqlAuthUpdateUserName: 'string'
      sqlStorageUpdateSettings: {
        diskConfigurationType: 'string'
        diskCount: int
        startingDeviceId: int
      sqlWorkloadTypeUpdateSettings: {
        sqlWorkloadType: 'string'
    sqlImageOffer: 'string'
    sqlImageSku: 'string'
    sqlManagement: 'string'
    sqlServerLicenseType: 'string'
    sqlVirtualMachineGroupResourceId: 'string'
    storageConfigurationSettings: {
      diskConfigurationType: 'string'
      sqlDataSettings: {
        defaultFilePath: 'string'
        luns: [
      sqlLogSettings: {
        defaultFilePath: 'string'
        luns: [
      sqlTempDbSettings: {
        defaultFilePath: 'string'
        luns: [
      storageWorkloadType: 'string'
    virtualMachineResourceId: 'string'
    wsfcDomainCredentials: {
      clusterBootstrapAccountPassword: 'string'
      clusterOperatorAccountPassword: 'string'
      sqlServiceAccountPassword: 'string'

Property values


Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
name The resource name string (required)
location Resource location. string (required)
tags Resource tags. Dictionary of tag names and values. See Tags in templates
identity Azure Active Directory identity configuration for a resource. ResourceIdentity
properties The SQL virtual machine properties. SqlVirtualMachineProperties


Name Description Value
type The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. 'SystemAssigned'


Name Description Value
autoBackupSettings Configure backups for databases in your SQL virtual machine. AutoBackupSettings
autoPatchingSettings Set a patching window during which Windows and SQL patches will be applied. AutoPatchingSettings
keyVaultCredentialSettings Configure your SQL virtual machine to be able to connect to the Azure Key Vault service. KeyVaultCredentialSettings
serverConfigurationsManagementSettings Set the connectivity, storage and workload settings. ServerConfigurationsManagementSettings
sqlImageOffer SQL image offer. Examples include SQL2016-WS2016, SQL2017-WS2016. string
sqlImageSku SQL Server edition type. 'Developer'
sqlManagement SQL Server Management type. 'Full'
sqlServerLicenseType SQL Server license type. 'AHUB'
sqlVirtualMachineGroupResourceId ARM resource id of the SQL virtual machine group this SQL virtual machine is or will be part of. string
storageConfigurationSettings Storage Configurations for SQL Data, Log and TempDb. StorageConfigurationSettings
virtualMachineResourceId ARM Resource id of underlying virtual machine created from SQL marketplace image. string
wsfcDomainCredentials Domain credentials for setting up Windows Server Failover Cluster for SQL availability group. WsfcDomainCredentials


Name Description Value
backupScheduleType Backup schedule type. 'Automated'
backupSystemDbs Include or exclude system databases from auto backup. bool
enable Enable or disable autobackup on SQL virtual machine. bool
enableEncryption Enable or disable encryption for backup on SQL virtual machine. bool
fullBackupFrequency Frequency of full backups. In both cases, full backups begin during the next scheduled time window. 'Daily'
fullBackupStartTime Start time of a given day during which full backups can take place. 0-23 hours. int
fullBackupWindowHours Duration of the time window of a given day during which full backups can take place. 1-23 hours. int
logBackupFrequency Frequency of log backups. 5-60 minutes. int
password Password for encryption on backup. string
retentionPeriod Retention period of backup: 1-30 days. int
storageAccessKey Storage account key where backup will be taken to. string
storageAccountUrl Storage account url where backup will be taken to. string


Name Description Value
dayOfWeek Day of week to apply the patch on. 'Friday'
enable Enable or disable autopatching on SQL virtual machine. bool
maintenanceWindowDuration Duration of patching. int
maintenanceWindowStartingHour Hour of the day when patching is initiated. Local VM time. int


Name Description Value
azureKeyVaultUrl Azure Key Vault url. string
credentialName Credential name. string
enable Enable or disable key vault credential setting. bool
servicePrincipalName Service principal name to access key vault. string
servicePrincipalSecret Service principal name secret to access key vault. string


Name Description Value
additionalFeaturesServerConfigurations Additional SQL Server feature settings. AdditionalFeaturesServerConfigurations
sqlConnectivityUpdateSettings Set the access level and network port settings for SQL Server. SqlConnectivityUpdateSettings
sqlStorageUpdateSettings Set disk storage settings for SQL Server. SqlStorageUpdateSettings
sqlWorkloadTypeUpdateSettings Set workload type to optimize storage for SQL Server. SqlWorkloadTypeUpdateSettings


Name Description Value
isRServicesEnabled Enable or disable R services (SQL 2016 onwards). bool


Name Description Value
connectivityType SQL Server connectivity option. 'LOCAL'
port SQL Server port. int
sqlAuthUpdatePassword SQL Server sysadmin login password. string
sqlAuthUpdateUserName SQL Server sysadmin login to create. string


Name Description Value
diskConfigurationType Disk configuration to apply to SQL Server. 'ADD'
diskCount Virtual machine disk count. int
startingDeviceId Device id of the first disk to be updated. int


Name Description Value
sqlWorkloadType SQL Server workload type. 'DW'


Name Description Value
diskConfigurationType Disk configuration to apply to SQL Server. 'ADD'
sqlDataSettings Set disk storage settings for SQL Server. SQLStorageSettings
sqlLogSettings Set disk storage settings for SQL Server. SQLStorageSettings
sqlTempDbSettings Set disk storage settings for SQL Server. SQLStorageSettings
storageWorkloadType Storage workload type. 'DW'


Name Description Value
defaultFilePath SQL Server default file path string
luns Logical Unit Numbers for the disks. int[]


Name Description Value
clusterBootstrapAccountPassword Cluster bootstrap account password. string
clusterOperatorAccountPassword Cluster operator account password. string
sqlServiceAccountPassword SQL service account password. string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Deploy SQL Always ON setup with existing SQL Virtual Machines

Deploy to Azure
Deploy SQL Always ON setup with existing SQL Virtual Machines. The virtual machines should already be joined to an existing domain and must be running enterprise version of SQL Server.
SQL Server VM with performance optimized storage settings

Deploy to Azure
Create a SQL Server Virtual Machine with performance optimized storage settings on PremiumSSD
SQL VM Performance Optimized Storage Settings on UltraSSD

Deploy to Azure
Create a SQL Server Virtual Machine with performance optimized storage settings, using UltraSSD for SQL Log files