Sql Virtual Machines - Get
Gets a SQL virtual machine.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}?api-version=2023-10-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}?$expand={$expand}&api-version=2023-10-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
sql
|
path | True |
string |
Name of the SQL virtual machine. Regex pattern: |
subscription
|
path | True |
string |
Subscription ID that identifies an Azure subscription. |
api-version
|
query | True |
string |
API version to use for the request. |
$expand
|
query |
string |
The child resources to include in the response. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Successfully retrieved the SQL virtual machine. |
|
Other Status Codes |
*** Error Responses: ***
|
Examples
Gets a SQL virtual machine.
Sample request
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
Sample response
{
"properties": {
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
"provisioningState": "Succeeded",
"sqlServerLicenseType": "PAYG",
"sqlImageSku": "Enterprise",
"sqlImageOffer": "SQL2022-WS2022",
"sqlManagement": "Full",
"leastPrivilegeMode": "Enabled",
"enableAutomaticUpgrade": true,
"additionalVmPatch": "WU",
"osType": "Windows",
"virtualMachineIdentitySettings": {
"type": "SystemAssigned"
}
},
"location": "northeurope",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines"
}
Definitions
Name | Description |
---|---|
AADAuthentication |
Enable AAD authentication for SQL VM. |
Additional |
Additional SQL Server feature settings. |
Additional |
Additional VM Patching solution enabled on the Virtual Machine |
Additional |
Additional Patch to be enable or enabled on the SQL Virtual Machine. |
Assessment |
Day of the week to run assessment. |
Assessment |
Configure SQL best practices Assessment for databases in your SQL virtual machine. |
Auto |
Days of the week for the backups when FullBackupFrequency is set to Weekly. |
Auto |
Configure backups for databases in your SQL virtual machine. |
Auto |
Set a patching window during which Windows and SQL patches will be applied. |
Backup |
Backup schedule type. |
Connectivity |
SQL Server connectivity option. |
created |
The type of identity that created the resource. |
Day |
Day of week to apply the patch on. |
Disk |
Disk configuration to apply to SQL Server. |
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
Full |
Frequency of full backups. In both cases, full backups begin during the next scheduled time window. |
Identity |
The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. |
Key |
Configure your SQL virtual machine to be able to connect to the Azure Key Vault service. |
Least |
SQL IaaS Agent least privilege mode. |
Os |
Operating System of the current SQL Virtual Machine. |
Resource |
Azure Active Directory identity configuration for a resource. |
Schedule |
Set assessment schedule for SQL Server. |
Server |
Set the connectivity, storage and workload settings. |
Sql |
Set the access level and network port settings for SQL Server. |
Sql |
SQL Server edition type. |
SQLInstance |
Set the server/instance-level settings for SQL Server. |
Sql |
SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect the Sql Management, refrain from using it. |
Sql |
SQL Server license type. |
SQLStorage |
Set disk storage settings for SQL Server. |
Sql |
Set disk storage settings for SQL Server. |
SQLTemp |
Set tempDb storage settings for SQL Server. |
Sql |
A SQL virtual machine. |
Sql |
SQL Server workload type. |
Sql |
Set workload type to optimize storage for SQL Server. |
Storage |
Storage Configurations for SQL Data, Log and TempDb. |
Storage |
Storage workload type. |
system |
Metadata pertaining to creation and last modification of the resource. |
Troubleshooting |
SQL VM Troubleshooting additional properties. |
Troubleshooting |
SQL VM troubleshooting scenario. |
Troubleshooting |
Status of last troubleshooting operation on this SQL VM |
Unhealthy |
SQL VM Troubleshoot UnhealthyReplica scenario information. |
Virtual |
Virtual Machine Identity details used for Sql IaaS extension configurations. |
Vm |
Identity type of the virtual machine. Specify None to opt-out of Managed Identities. |
Wsfc |
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
Name | Type | Description |
---|---|---|
WSUS |
string |
|
WU |
string |
|
WUMU |
string |
AdditionalVmPatch
Additional Patch to be enable or enabled on the SQL Virtual Machine.
Name | Type | Description |
---|---|---|
MicrosoftUpdate |
string |
|
NotSet |
string |
AssessmentDayOfWeek
Day of the week to run assessment.
Name | Type | Description |
---|---|---|
Friday |
string |
|
Monday |
string |
|
Saturday |
string |
|
Sunday |
string |
|
Thursday |
string |
|
Tuesday |
string |
|
Wednesday |
string |
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 for SQL best practices Assessment. |
AutoBackupDaysOfWeek
Days of the week for the backups when FullBackupFrequency is set to Weekly.
Name | Type | Description |
---|---|---|
Friday |
string |
|
Monday |
string |
|
Saturday |
string |
|
Sunday |
string |
|
Thursday |
string |
|
Tuesday |
string |
|
Wednesday |
string |
AutoBackupSettings
Configure backups for databases in your SQL virtual machine.
Name | Type | Description |
---|---|---|
backupScheduleType |
Backup schedule type. |
|
backupSystemDbs |
boolean |
Include or exclude system databases from auto backup. |
daysOfWeek |
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 |
Frequency of full backups. In both cases, full backups begin during the next scheduled time window. |
|
fullBackupStartTime |
integer |
Start time of a given day during which full backups can take place. 0-23 hours. |
fullBackupWindowHours |
integer |
Duration of the time window of a given day during which full backups can take place. 1-23 hours. |
logBackupFrequency |
integer |
Frequency of log backups. 5-60 minutes. |
password |
string |
Password for encryption on backup. |
retentionPeriod |
integer |
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 | NotSet |
Additional Patch to be enable or enabled on the SQL Virtual Machine. |
|
dayOfWeek |
Day of week to apply the patch on. |
||
enable |
boolean |
Enable or disable autopatching on SQL virtual machine. |
|
maintenanceWindowDuration |
integer |
Duration of patching. |
|
maintenanceWindowStartingHour |
integer |
Hour of the day when patching is initiated. Local VM time. |
BackupScheduleType
Backup schedule type.
Name | Type | Description |
---|---|---|
Automated |
string |
|
Manual |
string |
ConnectivityType
SQL Server connectivity option.
Name | Type | Description |
---|---|---|
LOCAL |
string |
|
PRIVATE |
string |
|
PUBLIC |
string |
createdByType
The type of identity that created the resource.
Name | Type | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
DayOfWeek
Day of week to apply the patch on.
Name | Type | Description |
---|---|---|
Everyday |
string |
|
Friday |
string |
|
Monday |
string |
|
Saturday |
string |
|
Sunday |
string |
|
Thursday |
string |
|
Tuesday |
string |
|
Wednesday |
string |
DiskConfigurationType
Disk configuration to apply to SQL Server.
Name | Type | Description |
---|---|---|
ADD |
string |
|
EXTEND |
string |
|
NEW |
string |
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 |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
FullBackupFrequencyType
Frequency of full backups. In both cases, full backups begin during the next scheduled time window.
Name | Type | Description |
---|---|---|
Daily |
string |
|
Weekly |
string |
IdentityType
The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
Name | Type | Description |
---|---|---|
None |
string |
|
SystemAssigned |
string |
|
SystemAssigned,UserAssigned |
string |
|
UserAssigned |
string |
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.
Name | Type | Description |
---|---|---|
Enabled |
string |
|
NotSet |
string |
OsType
Operating System of the current SQL Virtual Machine.
Name | Type | Description |
---|---|---|
Linux |
string |
|
Windows |
string |
ResourceIdentity
Azure Active Directory identity configuration for a resource.
Name | Type | Description |
---|---|---|
principalId |
string |
The Azure Active Directory principal id. |
tenantId |
string |
The Azure Active Directory tenant id. |
type |
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 |
Day of the week to run assessment. |
|
enable |
boolean |
Enable or disable assessment schedule on SQL virtual machine. |
monthlyOccurrence |
integer |
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 |
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 |
Additional SQL feature settings. |
|
azureAdAuthenticationSettings |
Azure AD authentication Settings. |
|
sqlConnectivityUpdateSettings |
SQL connectivity type settings. |
|
sqlInstanceSettings |
SQL Instance settings. |
|
sqlStorageUpdateSettings |
SQL storage update settings. |
|
sqlWorkloadTypeUpdateSettings |
SQL workload type settings. |
SqlConnectivityUpdateSettings
Set the access level and network port settings for SQL Server.
Name | Type | Description |
---|---|---|
connectivityType |
SQL Server connectivity option. |
|
port |
integer |
SQL Server port. |
sqlAuthUpdatePassword |
string |
SQL Server sysadmin login password. |
sqlAuthUpdateUserName |
string |
SQL Server sysadmin login to create. |
SqlImageSku
SQL Server edition type.
Name | Type | Description |
---|---|---|
Developer |
string |
|
Enterprise |
string |
|
Express |
string |
|
Standard |
string |
|
Web |
string |
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 |
SQL Server MAXDOP. |
maxServerMemoryMB |
integer |
SQL Server maximum memory. |
minServerMemoryMB |
integer |
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.
Name | Type | Description |
---|---|---|
Full |
string |
|
LightWeight |
string |
|
NoAgent |
string |
SqlServerLicenseType
SQL Server license type.
Name | Type | Description |
---|---|---|
AHUB |
string |
|
DR |
string |
|
PAYG |
string |
SQLStorageSettings
Set disk storage settings for SQL Server.
Name | Type | Description |
---|---|---|
defaultFilePath |
string |
SQL Server default file path |
luns |
integer[] |
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 |
Disk configuration to apply to SQL Server. |
|
diskCount |
integer |
Virtual machine disk count. |
startingDeviceId |
integer |
Device id of the first disk to be updated. |
SQLTempDbSettings
Set tempDb storage settings for SQL Server.
Name | Type | Description |
---|---|---|
dataFileCount |
integer |
SQL Server tempdb data file count |
dataFileSize |
integer |
SQL Server tempdb data file size |
dataGrowth |
integer |
SQL Server tempdb data file autoGrowth size |
defaultFilePath |
string |
SQL Server default file path |
logFileSize |
integer |
SQL Server tempdb log file size |
logGrowth |
integer |
SQL Server tempdb log file autoGrowth size |
luns |
integer[] |
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 |
Resource ID. |
|
identity |
DO NOT USE. This value will be deprecated. Azure Active Directory identity of the server. |
||
location |
string |
Resource location. |
|
name |
string |
Resource name. |
|
properties.additionalVmPatch |
Additional VM Patching solution enabled on the Virtual Machine |
||
properties.assessmentSettings |
SQL best practices Assessment Settings. |
||
properties.autoBackupSettings |
Auto backup settings for SQL Server. |
||
properties.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 |
Key vault credential settings. |
||
properties.leastPrivilegeMode | NotSet |
SQL IaaS Agent least privilege mode. |
|
properties.osType |
Operating System of the current SQL Virtual Machine. |
||
properties.provisioningState |
string |
Provisioning state to track the async operation status. |
|
properties.serverConfigurationsManagementSettings |
SQL Server configuration management settings. |
||
properties.sqlImageOffer |
string |
SQL image offer. Examples include SQL2016-WS2016, SQL2017-WS2016. |
|
properties.sqlImageSku |
SQL Server edition type. |
||
properties.sqlManagement |
SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect the Sql Management, refrain from using it. |
||
properties.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 |
Storage Configuration Settings. |
||
properties.troubleshootingStatus |
Troubleshooting status |
||
properties.virtualMachineIdentitySettings |
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 |
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 |
Metadata pertaining to creation and last modification of the resource. |
||
tags |
object |
Resource tags. |
|
type |
string |
Resource type. |
SqlWorkloadType
SQL Server workload type.
Name | Type | Description |
---|---|---|
DW |
string |
|
GENERAL |
string |
|
OLTP |
string |
SqlWorkloadTypeUpdateSettings
Set workload type to optimize storage for SQL Server.
Name | Type | Description |
---|---|---|
sqlWorkloadType |
SQL Server workload type. |
StorageConfigurationSettings
Storage Configurations for SQL Data, Log and TempDb.
Name | Type | Default value | Description |
---|---|---|---|
diskConfigurationType |
Disk configuration to apply to SQL Server. |
||
enableStorageConfigBlade |
boolean |
False |
Enable SQL IaaS Agent storage configuration blade in Azure Portal. |
sqlDataSettings |
SQL Server Data Storage Settings. |
||
sqlLogSettings |
SQL Server Log Storage Settings. |
||
sqlSystemDbOnDataDisk |
boolean |
SQL Server SystemDb Storage on DataPool if true. |
|
sqlTempDbSettings |
SQL Server TempDb Storage Settings. |
||
storageWorkloadType |
Storage workload type. |
StorageWorkloadType
Storage workload type.
Name | Type | Description |
---|---|---|
DW |
string |
|
GENERAL |
string |
|
OLTP |
string |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |
TroubleshootingAdditionalProperties
SQL VM Troubleshooting additional properties.
Name | Type | Description |
---|---|---|
unhealthyReplicaInfo |
The unhealthy replica information |
TroubleshootingScenario
SQL VM troubleshooting scenario.
Name | Type | Description |
---|---|---|
UnhealthyReplica |
string |
TroubleshootingStatus
Status of last troubleshooting operation on this SQL VM
Name | Type | Default value | Description |
---|---|---|---|
endTimeUtc |
string |
End time in UTC timezone. |
|
lastTriggerTimeUtc |
string |
Last troubleshooting trigger time in UTC timezone |
|
properties |
Troubleshooting properties |
||
rootCause |
string |
Root cause of the issue |
|
startTimeUtc |
string |
Start time in UTC timezone. |
|
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 Resource Id of the identity. Only required when UserAssigned identity is selected. |
type |
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.
Name | Type | Description |
---|---|---|
None |
string |
|
SystemAssigned |
string |
|
UserAssigned |
string |
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. |