Share via


Sql Virtual Machines - Update

Updates SQL virtual machine tags.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}?api-version=2023-10-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

sqlVirtualMachineName
path True

string

minLength: 1
maxLength: 64
pattern: ^((?!_)[^\\/"'\[\]:|<>+=;,?*@&]{1,64}(?

Name of the SQL virtual machine.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
tags

object

Resource tags.

Responses

Name Type Description
200 OK

SqlVirtualMachine

The request has succeeded.

Headers

Azure-AsyncOperation: string

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Updates a SQL virtual machine tags.

Sample request

PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01

{
  "tags": {
    "mytag": "myval"
  }
}

Sample response

{
  "name": "testvm",
  "type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
  "location": "northeurope",
  "properties": {
    "additionalVmPatch": "WUMU",
    "enableAutomaticUpgrade": true,
    "leastPrivilegeMode": "Enabled",
    "osType": "Windows",
    "provisioningState": "Updating",
    "sqlImageOffer": "SQL2022-WS2022",
    "sqlImageSku": "Enterprise",
    "sqlManagement": "Full",
    "sqlServerLicenseType": "PAYG",
    "virtualMachineIdentitySettings": {
      "type": "SystemAssigned"
    },
    "virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
  },
  "tags": {
    "mytag": "myval"
  }
}

Definitions

Name Description
AADAuthenticationSettings

Enable AAD authentication for SQL VM.

AdditionalFeaturesServerConfigurations

Additional SQL Server feature settings.

AdditionalOsPatch

Additional VM Patching solution enabled on the Virtual Machine

AdditionalVmPatch

Additional Patch to be enable or enabled on the SQL Virtual Machine.

AssessmentDayOfWeek

Day of the week to run assessment.

AssessmentSettings

Configure SQL best practices Assessment for databases in your SQL virtual machine.

AutoBackupDaysOfWeek
AutoBackupSettings

Configure backups for databases in your SQL virtual machine.

AutoPatchingSettings

Set a patching window during which Windows and SQL patches will be applied.

BackupScheduleType

Backup schedule type.

ConnectivityType

SQL Server connectivity option.

createdByType

The type of identity that created the resource.

DayOfWeek

Day of week to apply the patch on.

DiskConfigurationType

Disk configuration to apply to SQL Server.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

FullBackupFrequencyType

Frequency of full backups. In both cases, full backups begin during the next scheduled time window.

IdentityType

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

KeyVaultCredentialSettings

Configure your SQL virtual machine to be able to connect to the Azure Key Vault service.

LeastPrivilegeMode

SQL IaaS Agent least privilege mode.

OsType

Operating System of the current SQL Virtual Machine.

ResourceIdentity

Azure Active Directory identity configuration for a resource.

Schedule

Set assessment schedule for SQL Server.

ServerConfigurationsManagementSettings

Set the connectivity, storage and workload settings.

SqlConnectivityUpdateSettings

Set the access level and network port settings for SQL Server.

SqlImageSku

SQL Server edition type.

SQLInstanceSettings

Set the server/instance-level settings for SQL Server.

SqlManagementMode

SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect the Sql Management, refrain from using it.

SqlServerLicenseType

SQL Server license type.

SQLStorageSettings

Set disk storage settings for SQL Server.

SqlStorageUpdateSettings

Set disk storage settings for SQL Server.

SQLTempDbSettings

Set tempDb storage settings for SQL Server.

SqlVirtualMachine

A SQL virtual machine.

SqlVirtualMachineUpdate

An update to a SQL virtual machine.

SqlWorkloadType

SQL Server workload type.

SqlWorkloadTypeUpdateSettings

Set workload type to optimize storage for SQL Server.

StorageConfigurationSettings

Storage Configurations for SQL Data, Log and TempDb.

StorageWorkloadType

Storage workload type.

systemData

Metadata pertaining to creation and last modification of the resource.

TroubleshootingAdditionalProperties

SQL VM Troubleshooting additional properties.

TroubleshootingScenario

SQL VM troubleshooting scenario.

TroubleshootingStatus

Status of last troubleshooting operation on this SQL VM

UnhealthyReplicaInfo

SQL VM Troubleshoot UnhealthyReplica scenario information.

VirtualMachineIdentity

Virtual Machine Identity details used for Sql IaaS extension configurations.

VmIdentityType

Identity type of the virtual machine. Specify None to opt-out of Managed Identities.

WsfcDomainCredentials

Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.

AADAuthenticationSettings

Enable AAD authentication for SQL VM.

Name Type Description
clientId

string

The client Id of the Managed Identity to query Microsoft Graph API. An empty string must be used for the system assigned Managed Identity

AdditionalFeaturesServerConfigurations

Additional SQL Server feature settings.

Name Type Description
isRServicesEnabled

boolean

Enable or disable R services (SQL 2016 onwards).

AdditionalOsPatch

Additional VM Patching solution enabled on the Virtual Machine

Value Description
WU
WUMU
WSUS

AdditionalVmPatch

Additional Patch to be enable or enabled on the SQL Virtual Machine.

Value Description
NotSet
MicrosoftUpdate

AssessmentDayOfWeek

Day of the week to run assessment.

Value Description
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

AssessmentSettings

Configure SQL best practices Assessment for databases in your SQL virtual machine.

Name Type Description
enable

boolean

Enable or disable SQL best practices Assessment feature on SQL virtual machine.

runImmediately

boolean

Run SQL best practices Assessment immediately on SQL virtual machine.

schedule

Schedule

Schedule for SQL best practices Assessment.

AutoBackupDaysOfWeek

Value Description
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

AutoBackupSettings

Configure backups for databases in your SQL virtual machine.

Name Type Description
backupScheduleType

BackupScheduleType

Backup schedule type.

backupSystemDbs

boolean

Include or exclude system databases from auto backup.

daysOfWeek

AutoBackupDaysOfWeek[]

Days of the week for the backups when FullBackupFrequency is set to Weekly.

enable

boolean

Enable or disable autobackup on SQL virtual machine.

enableEncryption

boolean

Enable or disable encryption for backup on SQL virtual machine.

fullBackupFrequency

FullBackupFrequencyType

Frequency of full backups. In both cases, full backups begin during the next scheduled time window.

fullBackupStartTime

integer (int32)

Start time of a given day during which full backups can take place. 0-23 hours.

fullBackupWindowHours

integer (int32)

Duration of the time window of a given day during which full backups can take place. 1-23 hours.

logBackupFrequency

integer (int32)

Frequency of log backups. 5-60 minutes.

password

string

Password for encryption on backup.

retentionPeriod

integer (int32)

Retention period of backup: 1-90 days.

storageAccessKey

string

Storage account key where backup will be taken to.

storageAccountUrl

string

Storage account url where backup will be taken to.

storageContainerName

string

Storage container name where backup will be taken to.

AutoPatchingSettings

Set a patching window during which Windows and SQL patches will be applied.

Name Type Default value Description
additionalVmPatch

AdditionalVmPatch

NotSet

Additional Patch to be enable or enabled on the SQL Virtual Machine.

dayOfWeek

DayOfWeek

Day of week to apply the patch on.

enable

boolean

Enable or disable autopatching on SQL virtual machine.

maintenanceWindowDuration

integer (int32)

Duration of patching.

maintenanceWindowStartingHour

integer (int32)

Hour of the day when patching is initiated. Local VM time.

BackupScheduleType

Backup schedule type.

Value Description
Manual
Automated

ConnectivityType

SQL Server connectivity option.

Value Description
LOCAL
PRIVATE
PUBLIC

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

DayOfWeek

Day of week to apply the patch on.

Value Description
Everyday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

DiskConfigurationType

Disk configuration to apply to SQL Server.

Value Description
NEW
EXTEND
ADD

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

FullBackupFrequencyType

Frequency of full backups. In both cases, full backups begin during the next scheduled time window.

Value Description
Daily
Weekly

IdentityType

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

Value Description
None
SystemAssigned
UserAssigned
SystemAssigned,UserAssigned

KeyVaultCredentialSettings

Configure your SQL virtual machine to be able to connect to the Azure Key Vault service.

Name Type Description
azureKeyVaultUrl

string

Azure Key Vault url.

credentialName

string

Credential name.

enable

boolean

Enable or disable key vault credential setting.

servicePrincipalName

string

Service principal name to access key vault.

servicePrincipalSecret

string

Service principal name secret to access key vault.

LeastPrivilegeMode

SQL IaaS Agent least privilege mode.

Value Description
Enabled
NotSet

OsType

Operating System of the current SQL Virtual Machine.

Value Description
Windows
Linux

ResourceIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
principalId

string (uuid)

The Azure Active Directory principal id.

tenantId

string (uuid)

The Azure Active Directory tenant id.

type

IdentityType

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

Schedule

Set assessment schedule for SQL Server.

Name Type Description
dayOfWeek

AssessmentDayOfWeek

Day of the week to run assessment.

enable

boolean

Enable or disable assessment schedule on SQL virtual machine.

monthlyOccurrence

integer (int32)

Occurrence of the DayOfWeek day within a month to schedule assessment. Takes values: 1,2,3,4 and -1. Use -1 for last DayOfWeek day of the month

startTime

string

Time of the day in HH:mm format. Eg. 17:30

weeklyInterval

integer (int32)

Number of weeks to schedule between 2 assessment runs. Takes value from 1-6

ServerConfigurationsManagementSettings

Set the connectivity, storage and workload settings.

Name Type Description
additionalFeaturesServerConfigurations

AdditionalFeaturesServerConfigurations

Additional SQL feature settings.

azureAdAuthenticationSettings

AADAuthenticationSettings

Azure AD authentication Settings.

sqlConnectivityUpdateSettings

SqlConnectivityUpdateSettings

SQL connectivity type settings.

sqlInstanceSettings

SQLInstanceSettings

SQL Instance settings.

sqlStorageUpdateSettings

SqlStorageUpdateSettings

SQL storage update settings.

sqlWorkloadTypeUpdateSettings

SqlWorkloadTypeUpdateSettings

SQL workload type settings.

SqlConnectivityUpdateSettings

Set the access level and network port settings for SQL Server.

Name Type Description
connectivityType

ConnectivityType

SQL Server connectivity option.

port

integer (int32)

SQL Server port.

sqlAuthUpdatePassword

string

SQL Server sysadmin login password.

sqlAuthUpdateUserName

string

SQL Server sysadmin login to create.

SqlImageSku

SQL Server edition type.

Value Description
Developer
Express
Standard
Enterprise
Web

SQLInstanceSettings

Set the server/instance-level settings for SQL Server.

Name Type Description
collation

string

SQL Server Collation.

isIfiEnabled

boolean

SQL Server IFI.

isLpimEnabled

boolean

SQL Server LPIM.

isOptimizeForAdHocWorkloadsEnabled

boolean

SQL Server Optimize for Adhoc workloads.

maxDop

integer (int32)

SQL Server MAXDOP.

maxServerMemoryMB

integer (int32)

SQL Server maximum memory.

minServerMemoryMB

integer (int32)

SQL Server minimum memory.

SqlManagementMode

SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect the Sql Management, refrain from using it.

Value Description
Full
LightWeight
NoAgent

SqlServerLicenseType

SQL Server license type.

Value Description
PAYG
AHUB
DR

SQLStorageSettings

Set disk storage settings for SQL Server.

Name Type Description
defaultFilePath

string

SQL Server default file path

luns

integer[] (int32)

Logical Unit Numbers for the disks.

useStoragePool

boolean

Use storage pool to build a drive if true or not provided

SqlStorageUpdateSettings

Set disk storage settings for SQL Server.

Name Type Description
diskConfigurationType

DiskConfigurationType

Disk configuration to apply to SQL Server.

diskCount

integer (int32)

Virtual machine disk count.

startingDeviceId

integer (int32)

Device id of the first disk to be updated.

SQLTempDbSettings

Set tempDb storage settings for SQL Server.

Name Type Description
dataFileCount

integer (int32)

SQL Server tempdb data file count

dataFileSize

integer (int32)

SQL Server tempdb data file size

dataGrowth

integer (int32)

SQL Server tempdb data file autoGrowth size

defaultFilePath

string

SQL Server default file path

logFileSize

integer (int32)

SQL Server tempdb log file size

logGrowth

integer (int32)

SQL Server tempdb log file autoGrowth size

luns

integer[] (int32)

Logical Unit Numbers for the disks.

persistFolder

boolean

SQL Server tempdb persist folder choice

persistFolderPath

string

SQL Server tempdb persist folder location

useStoragePool

boolean

Use storage pool to build a drive if true or not provided

SqlVirtualMachine

A SQL virtual machine.

Name Type Default value Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

ResourceIdentity

DO NOT USE. This value will be deprecated. Azure Active Directory identity of the server.

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties.additionalVmPatch

AdditionalOsPatch

Additional VM Patching solution enabled on the Virtual Machine

properties.assessmentSettings

AssessmentSettings

SQL best practices Assessment Settings.

properties.autoBackupSettings

AutoBackupSettings

Auto backup settings for SQL Server.

properties.autoPatchingSettings

AutoPatchingSettings

Auto patching settings for applying critical security updates to SQL virtual machine.

properties.enableAutomaticUpgrade

boolean

False

Enable automatic upgrade of Sql IaaS extension Agent.

properties.keyVaultCredentialSettings

KeyVaultCredentialSettings

Key vault credential settings.

properties.leastPrivilegeMode

LeastPrivilegeMode

NotSet

SQL IaaS Agent least privilege mode.

properties.osType

OsType

Operating System of the current SQL Virtual Machine.

properties.provisioningState

string

Provisioning state to track the async operation status.

properties.serverConfigurationsManagementSettings

ServerConfigurationsManagementSettings

SQL Server configuration management settings.

properties.sqlImageOffer

string

SQL image offer. Examples include SQL2016-WS2016, SQL2017-WS2016.

properties.sqlImageSku

SqlImageSku

SQL Server edition type.

properties.sqlManagement

SqlManagementMode

SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect the Sql Management, refrain from using it.

properties.sqlServerLicenseType

SqlServerLicenseType

SQL Server license type.

properties.sqlVirtualMachineGroupResourceId

string

ARM resource id of the SQL virtual machine group this SQL virtual machine is or will be part of.

properties.storageConfigurationSettings

StorageConfigurationSettings

Storage Configuration Settings.

properties.troubleshootingStatus

TroubleshootingStatus

Troubleshooting status

properties.virtualMachineIdentitySettings

VirtualMachineIdentity

Virtual Machine Identity details used for Sql IaaS extension configurations.

properties.virtualMachineResourceId

string

ARM Resource id of underlying virtual machine created from SQL marketplace image.

properties.wsfcDomainCredentials

WsfcDomainCredentials

Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.

properties.wsfcStaticIp

string

Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

SqlVirtualMachineUpdate

An update to a SQL virtual machine.

Name Type Description
tags

object

Resource tags.

SqlWorkloadType

SQL Server workload type.

Value Description
GENERAL
OLTP
DW

SqlWorkloadTypeUpdateSettings

Set workload type to optimize storage for SQL Server.

Name Type Description
sqlWorkloadType

SqlWorkloadType

SQL Server workload type.

StorageConfigurationSettings

Storage Configurations for SQL Data, Log and TempDb.

Name Type Default value Description
diskConfigurationType

DiskConfigurationType

Disk configuration to apply to SQL Server.

enableStorageConfigBlade

boolean

False

Enable SQL IaaS Agent storage configuration blade in Azure Portal.

sqlDataSettings

SQLStorageSettings

SQL Server Data Storage Settings.

sqlLogSettings

SQLStorageSettings

SQL Server Log Storage Settings.

sqlSystemDbOnDataDisk

boolean

SQL Server SystemDb Storage on DataPool if true.

sqlTempDbSettings

SQLTempDbSettings

SQL Server TempDb Storage Settings.

storageWorkloadType

StorageWorkloadType

Storage workload type.

StorageWorkloadType

Storage workload type.

Value Description
GENERAL
OLTP
DW

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

TroubleshootingAdditionalProperties

SQL VM Troubleshooting additional properties.

Name Type Description
unhealthyReplicaInfo

UnhealthyReplicaInfo

The unhealthy replica information

TroubleshootingScenario

SQL VM troubleshooting scenario.

Value Description
UnhealthyReplica

TroubleshootingStatus

Status of last troubleshooting operation on this SQL VM

Name Type Default value Description
endTimeUtc

string (date-time)

End time in UTC timezone.

lastTriggerTimeUtc

string (date-time)

Last troubleshooting trigger time in UTC timezone

properties

TroubleshootingAdditionalProperties

Troubleshooting properties

rootCause

string

Root cause of the issue

startTimeUtc

string (date-time)

Start time in UTC timezone.

troubleshootingScenario

TroubleshootingScenario

UnhealthyReplica

SQL VM troubleshooting scenario.

UnhealthyReplicaInfo

SQL VM Troubleshoot UnhealthyReplica scenario information.

Name Type Description
availabilityGroupName

string

The name of the availability group

VirtualMachineIdentity

Virtual Machine Identity details used for Sql IaaS extension configurations.

Name Type Description
resourceId

string (arm-id)

ARM Resource Id of the identity. Only required when UserAssigned identity is selected.

type

VmIdentityType

Identity type of the virtual machine. Specify None to opt-out of Managed Identities.

VmIdentityType

Identity type of the virtual machine. Specify None to opt-out of Managed Identities.

Value Description
None
SystemAssigned
UserAssigned

WsfcDomainCredentials

Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.

Name Type Description
clusterBootstrapAccountPassword

string

Cluster bootstrap account password.

clusterOperatorAccountPassword

string

Cluster operator account password.

sqlServiceAccountPassword

string

SQL service account password.