Creates or updates a SQL virtual machine.
PUT 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 |
Required |
Type |
Description |
|
location
|
True
|
string
|
The geo-location where the resource lives
|
|
identity
|
|
ResourceIdentity
|
DO NOT USE. This value will be deprecated. Azure Active Directory identity of the server.
|
|
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
|
Enable automatic upgrade of Sql IaaS extension Agent.
|
|
properties.keyVaultCredentialSettings
|
|
KeyVaultCredentialSettings
|
Key vault credential settings.
|
|
properties.leastPrivilegeMode
|
|
LeastPrivilegeMode
|
SQL IaaS Agent least privilege mode.
|
|
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.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.
|
|
tags
|
|
object
|
Resource tags.
|
Responses
| Name |
Type |
Description |
|
200 OK
|
SqlVirtualMachine
|
Resource 'SqlVirtualMachine' update operation succeeded
|
|
201 Created
|
SqlVirtualMachine
|
Resource 'SqlVirtualMachine' create operation succeeded
Headers
- Azure-AsyncOperation: string
- Retry-After: integer
|
|
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
Creates or updates a SQL virtual machine and joins it to a SQL virtual machine group.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"sqlVirtualMachineGroupResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2",
"wsfcDomainCredentials": {
"clusterBootstrapAccountPassword": "<Password>",
"clusterOperatorAccountPassword": "<Password>",
"sqlServiceAccountPassword": "<Password>"
},
"wsfcStaticIp": "10.0.0.7"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_virtual_machine_with_vm_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"sqlVirtualMachineGroupResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2",
"wsfcDomainCredentials": {
"clusterBootstrapAccountPassword": "<Password>",
"clusterOperatorAccountPassword": "<Password>",
"sqlServiceAccountPassword": "<Password>",
},
"wsfcStaticIp": "10.0.0.7",
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateVirtualMachineWithVMGroup.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateVirtualMachineWithVMGroup.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineAndJoinsItToASqlVirtualMachineGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"),
WsfcDomainCredentials: &armsqlvirtualmachine.WsfcDomainCredentials{
ClusterBootstrapAccountPassword: to.Ptr("<Password>"),
ClusterOperatorAccountPassword: to.Ptr("<Password>"),
SQLServiceAccountPassword: to.Ptr("<Password>"),
},
WsfcStaticIP: to.Ptr("10.0.0.7"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm2"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(false),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeSystemAssigned),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"),
// WsfcStaticIP: to.Ptr("10.0.0.7"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateVirtualMachineWithVMGroup.json
*/
async function createsOrUpdatesASQLVirtualMachineAndJoinsItToASQLVirtualMachineGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
sqlVirtualMachineGroupResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2",
wsfcDomainCredentials: {
clusterBootstrapAccountPassword: "<Password>",
clusterOperatorAccountPassword: "<Password>",
sqlServiceAccountPassword: "<Password>",
},
wsfcStaticIp: "10.0.0.7",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testvm2",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2",
"location": "northeurope",
"properties": {
"additionalVmPatch": "WU",
"enableAutomaticUpgrade": false,
"leastPrivilegeMode": "Enabled",
"osType": "Windows",
"provisioningState": "Updating",
"sqlImageOffer": "SQL2022-WS2022",
"sqlImageSku": "Enterprise",
"sqlManagement": "Full",
"sqlServerLicenseType": "PAYG",
"sqlVirtualMachineGroupResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
"virtualMachineIdentitySettings": {
"type": "SystemAssigned"
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2",
"wsfcStaticIp": "10.0.0.7"
}
}
{
"name": "testvm2",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"sqlVirtualMachineGroupResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2",
"wsfcStaticIp": "10.0.0.7"
}
}
Creates or updates a SQL virtual machine for Automated Back up Settings with Weekly and Days of the week to run the back up.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"autoBackupSettings": {
"backupScheduleType": "Manual",
"backupSystemDbs": true,
"daysOfWeek": [
"Monday",
"Friday"
],
"enable": true,
"enableEncryption": true,
"fullBackupFrequency": "Weekly",
"fullBackupStartTime": 6,
"fullBackupWindowHours": 11,
"logBackupFrequency": 10,
"password": "<Password>",
"retentionPeriod": 17,
"storageAccessKey": "<primary storage access key>",
"storageAccountUrl": "https://teststorage.blob.core.windows.net/",
"storageContainerName": "testcontainer"
},
"autoPatchingSettings": {
"dayOfWeek": "Sunday",
"enable": true,
"maintenanceWindowDuration": 60,
"maintenanceWindowStartingHour": 2
},
"keyVaultCredentialSettings": {
"enable": false
},
"serverConfigurationsManagementSettings": {
"additionalFeaturesServerConfigurations": {
"isRServicesEnabled": false
},
"sqlConnectivityUpdateSettings": {
"connectivityType": "PRIVATE",
"port": 1433,
"sqlAuthUpdatePassword": "<password>",
"sqlAuthUpdateUserName": "sqllogin"
},
"sqlStorageUpdateSettings": {
"diskConfigurationType": "NEW",
"diskCount": 1,
"startingDeviceId": 2
},
"sqlWorkloadTypeUpdateSettings": {
"sqlWorkloadType": "OLTP"
}
},
"sqlImageSku": "Enterprise",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_sql_virtual_machine_automated_backup_weekly.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"autoBackupSettings": {
"backupScheduleType": "Manual",
"backupSystemDbs": True,
"daysOfWeek": ["Monday", "Friday"],
"enable": True,
"enableEncryption": True,
"fullBackupFrequency": "Weekly",
"fullBackupStartTime": 6,
"fullBackupWindowHours": 11,
"logBackupFrequency": 10,
"password": "<Password>",
"retentionPeriod": 17,
"storageAccessKey": "<primary storage access key>",
"storageAccountUrl": "https://teststorage.blob.core.windows.net/",
"storageContainerName": "testcontainer",
},
"autoPatchingSettings": {
"dayOfWeek": "Sunday",
"enable": True,
"maintenanceWindowDuration": 60,
"maintenanceWindowStartingHour": 2,
},
"keyVaultCredentialSettings": {"enable": False},
"serverConfigurationsManagementSettings": {
"additionalFeaturesServerConfigurations": {"isRServicesEnabled": False},
"sqlConnectivityUpdateSettings": {
"connectivityType": "PRIVATE",
"port": 1433,
"sqlAuthUpdatePassword": "<password>",
"sqlAuthUpdateUserName": "sqllogin",
},
"sqlStorageUpdateSettings": {"diskConfigurationType": "NEW", "diskCount": 1, "startingDeviceId": 2},
"sqlWorkloadTypeUpdateSettings": {"sqlWorkloadType": "OLTP"},
},
"sqlImageSku": "Enterprise",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineForAutomatedBackUpSettingsWithWeeklyAndDaysOfTheWeekToRunTheBackUp() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
AutoBackupSettings: &armsqlvirtualmachine.AutoBackupSettings{
BackupScheduleType: to.Ptr(armsqlvirtualmachine.BackupScheduleTypeManual),
BackupSystemDbs: to.Ptr(true),
DaysOfWeek: []*armsqlvirtualmachine.AutoBackupDaysOfWeek{
to.Ptr(armsqlvirtualmachine.AutoBackupDaysOfWeekMonday),
to.Ptr(armsqlvirtualmachine.AutoBackupDaysOfWeekFriday),
},
Enable: to.Ptr(true),
EnableEncryption: to.Ptr(true),
FullBackupFrequency: to.Ptr(armsqlvirtualmachine.FullBackupFrequencyTypeWeekly),
FullBackupStartTime: to.Ptr[int32](6),
FullBackupWindowHours: to.Ptr[int32](11),
LogBackupFrequency: to.Ptr[int32](10),
Password: to.Ptr("<Password>"),
RetentionPeriod: to.Ptr[int32](17),
StorageAccessKey: to.Ptr("<primary storage access key>"),
StorageAccountURL: to.Ptr("https://teststorage.blob.core.windows.net/"),
StorageContainerName: to.Ptr("testcontainer"),
},
AutoPatchingSettings: &armsqlvirtualmachine.AutoPatchingSettings{
DayOfWeek: to.Ptr(armsqlvirtualmachine.DayOfWeekSunday),
Enable: to.Ptr(true),
MaintenanceWindowDuration: to.Ptr[int32](60),
MaintenanceWindowStartingHour: to.Ptr[int32](2),
},
KeyVaultCredentialSettings: &armsqlvirtualmachine.KeyVaultCredentialSettings{
Enable: to.Ptr(false),
},
ServerConfigurationsManagementSettings: &armsqlvirtualmachine.ServerConfigurationsManagementSettings{
AdditionalFeaturesServerConfigurations: &armsqlvirtualmachine.AdditionalFeaturesServerConfigurations{
IsRServicesEnabled: to.Ptr(false),
},
SQLConnectivityUpdateSettings: &armsqlvirtualmachine.SQLConnectivityUpdateSettings{
ConnectivityType: to.Ptr(armsqlvirtualmachine.ConnectivityTypePRIVATE),
Port: to.Ptr[int32](1433),
SQLAuthUpdatePassword: to.Ptr("<password>"),
SQLAuthUpdateUserName: to.Ptr("sqllogin"),
},
SQLStorageUpdateSettings: &armsqlvirtualmachine.SQLStorageUpdateSettings{
DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
DiskCount: to.Ptr[int32](1),
StartingDeviceID: to.Ptr[int32](2),
},
SQLWorkloadTypeUpdateSettings: &armsqlvirtualmachine.SQLWorkloadTypeUpdateSettings{
SQLWorkloadType: to.Ptr(armsqlvirtualmachine.SQLWorkloadTypeOLTP),
},
},
SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(false),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeSystemAssigned),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json
*/
async function createsOrUpdatesASQLVirtualMachineForAutomatedBackUpSettingsWithWeeklyAndDaysOfTheWeekToRunTheBackUp() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
autoBackupSettings: {
backupScheduleType: "Manual",
backupSystemDbs: true,
daysOfWeek: ["Monday", "Friday"],
enable: true,
enableEncryption: true,
fullBackupFrequency: "Weekly",
fullBackupStartTime: 6,
fullBackupWindowHours: 11,
logBackupFrequency: 10,
password: "<Password>",
retentionPeriod: 17,
storageAccessKey: "<primary storage access key>",
storageAccountUrl: "https://teststorage.blob.core.windows.net/",
storageContainerName: "testcontainer",
},
autoPatchingSettings: {
dayOfWeek: "Sunday",
enable: true,
maintenanceWindowDuration: 60,
maintenanceWindowStartingHour: 2,
},
keyVaultCredentialSettings: { enable: false },
serverConfigurationsManagementSettings: {
additionalFeaturesServerConfigurations: { isRServicesEnabled: false },
sqlConnectivityUpdateSettings: {
connectivityType: "PRIVATE",
port: 1433,
sqlAuthUpdatePassword: "<password>",
sqlAuthUpdateUserName: "sqllogin",
},
sqlStorageUpdateSettings: { diskConfigurationType: "NEW", diskCount: 1, startingDeviceId: 2 },
sqlWorkloadTypeUpdateSettings: { sqlWorkloadType: "OLTP" },
},
sqlImageSku: "Enterprise",
sqlServerLicenseType: "PAYG",
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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": "WU",
"enableAutomaticUpgrade": false,
"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"
}
}
{
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
Creates or updates a SQL virtual machine for Storage Configuration Settings to EXTEND Data, Log or TempDB storage pool.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"storageConfigurationSettings": {
"diskConfigurationType": "EXTEND",
"sqlDataSettings": {
"luns": [
2
]
}
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_sql_virtual_machine_storage_configuration_extend.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"storageConfigurationSettings": {"diskConfigurationType": "EXTEND", "sqlDataSettings": {"luns": [2]}},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineForStorageConfigurationSettingsToExtendDataLogOrTempDbStoragePool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{
DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeEXTEND),
SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{
Luns: []*int32{
to.Ptr[int32](2),
},
},
},
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(true),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeSystemAssigned),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json
*/
async function createsOrUpdatesASQLVirtualMachineForStorageConfigurationSettingsToExtendDataLogOrTempDBStoragePool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
storageConfigurationSettings: {
diskConfigurationType: "EXTEND",
sqlDataSettings: { luns: [2] },
},
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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": "WU",
"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"
}
}
{
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
Creates or updates a SQL virtual machine for Storage Configuration Settings to NEW Data, Log and TempDB storage pool.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"storageConfigurationSettings": {
"diskConfigurationType": "NEW",
"sqlDataSettings": {
"defaultFilePath": "F:\\folderpath\\",
"luns": [
0
]
},
"sqlLogSettings": {
"defaultFilePath": "G:\\folderpath\\",
"luns": [
1
]
},
"sqlSystemDbOnDataDisk": true,
"sqlTempDbSettings": {
"dataFileCount": 8,
"dataFileSize": 256,
"dataGrowth": 512,
"defaultFilePath": "D:\\TEMP",
"logFileSize": 256,
"logGrowth": 512
},
"storageWorkloadType": "OLTP"
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_sql_virtual_machine_storage_configuration_new.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"storageConfigurationSettings": {
"diskConfigurationType": "NEW",
"sqlDataSettings": {"defaultFilePath": "F:\\folderpath\\", "luns": [0]},
"sqlLogSettings": {"defaultFilePath": "G:\\folderpath\\", "luns": [1]},
"sqlSystemDbOnDataDisk": True,
"sqlTempDbSettings": {
"dataFileCount": 8,
"dataFileSize": 256,
"dataGrowth": 512,
"defaultFilePath": "D:\\TEMP",
"logFileSize": 256,
"logGrowth": 512,
},
"storageWorkloadType": "OLTP",
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineForStorageConfigurationSettingsToNewDataLogAndTempDbStoragePool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{
DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{
DefaultFilePath: to.Ptr("F:\\folderpath\\"),
Luns: []*int32{
to.Ptr[int32](0),
},
},
SQLLogSettings: &armsqlvirtualmachine.SQLStorageSettings{
DefaultFilePath: to.Ptr("G:\\folderpath\\"),
Luns: []*int32{
to.Ptr[int32](1),
},
},
SQLSystemDbOnDataDisk: to.Ptr(true),
SQLTempDbSettings: &armsqlvirtualmachine.SQLTempDbSettings{
DataFileCount: to.Ptr[int32](8),
DataFileSize: to.Ptr[int32](256),
DataGrowth: to.Ptr[int32](512),
DefaultFilePath: to.Ptr("D:\\TEMP"),
LogFileSize: to.Ptr[int32](256),
LogGrowth: to.Ptr[int32](512),
},
StorageWorkloadType: to.Ptr(armsqlvirtualmachine.StorageWorkloadTypeOLTP),
},
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(false),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeSystemAssigned),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json
*/
async function createsOrUpdatesASQLVirtualMachineForStorageConfigurationSettingsToNEWDataLogAndTempDBStoragePool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
storageConfigurationSettings: {
diskConfigurationType: "NEW",
sqlDataSettings: { defaultFilePath: "F:\\folderpath\\", luns: [0] },
sqlLogSettings: { defaultFilePath: "G:\\folderpath\\", luns: [1] },
sqlSystemDbOnDataDisk: true,
sqlTempDbSettings: {
dataFileCount: 8,
dataFileSize: 256,
dataGrowth: 512,
defaultFilePath: "D:\\TEMP",
logFileSize: 256,
logGrowth: 512,
},
storageWorkloadType: "OLTP",
},
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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": "WU",
"enableAutomaticUpgrade": false,
"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"
}
}
{
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
Creates or updates a SQL virtual machine to enable the usage of Virtual Machine managed identity.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"virtualMachineIdentitySettings": {
"type": "UserAssigned",
"resourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity"
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_sql_virtual_machine_vm_identity_settings.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"virtualMachineIdentitySettings": {
"resourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity",
"type": "UserAssigned",
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineVmIdentitySettings.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateSqlVirtualMachineVmIdentitySettings.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineToEnableTheUsageOfVirtualMachineManagedIdentity() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeUserAssigned),
ResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity"),
},
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(false),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeUserAssigned),
// ResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity"),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineVmIdentitySettings.json
*/
async function createsOrUpdatesASQLVirtualMachineToEnableTheUsageOfVirtualMachineManagedIdentity() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
virtualMachineIdentitySettings: {
type: "UserAssigned",
resourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity",
},
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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": "WU",
"enableAutomaticUpgrade": false,
"leastPrivilegeMode": "Enabled",
"osType": "Windows",
"provisioningState": "Updating",
"sqlImageOffer": "SQL2022-WS2022",
"sqlImageSku": "Enterprise",
"sqlManagement": "Full",
"sqlServerLicenseType": "PAYG",
"virtualMachineIdentitySettings": {
"type": "UserAssigned",
"resourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity"
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
{
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"virtualMachineIdentitySettings": {
"type": "UserAssigned",
"resourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testvmidentity"
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
Creates or updates a SQL virtual machine with max parameters.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"assessmentSettings": {
"enable": true,
"runImmediately": true,
"schedule": {
"dayOfWeek": "Sunday",
"enable": true,
"monthlyOccurrence": null,
"startTime": "23:17",
"weeklyInterval": 1
}
},
"autoBackupSettings": {
"backupScheduleType": "Manual",
"backupSystemDbs": true,
"enable": true,
"enableEncryption": true,
"fullBackupFrequency": "Daily",
"fullBackupStartTime": 6,
"fullBackupWindowHours": 11,
"logBackupFrequency": 10,
"password": "<Password>",
"retentionPeriod": 17,
"storageAccessKey": "<primary storage access key>",
"storageAccountUrl": "https://teststorage.blob.core.windows.net/",
"storageContainerName": "testcontainer"
},
"autoPatchingSettings": {
"dayOfWeek": "Sunday",
"enable": true,
"maintenanceWindowDuration": 60,
"maintenanceWindowStartingHour": 2
},
"enableAutomaticUpgrade": true,
"keyVaultCredentialSettings": {
"enable": false
},
"leastPrivilegeMode": "Enabled",
"serverConfigurationsManagementSettings": {
"additionalFeaturesServerConfigurations": {
"isRServicesEnabled": false
},
"azureAdAuthenticationSettings": {
"clientId": "11111111-2222-3333-4444-555555555555"
},
"sqlConnectivityUpdateSettings": {
"connectivityType": "PRIVATE",
"port": 1433,
"sqlAuthUpdatePassword": "<password>",
"sqlAuthUpdateUserName": "sqllogin"
},
"sqlInstanceSettings": {
"collation": "SQL_Latin1_General_CP1_CI_AS",
"isIfiEnabled": true,
"isLpimEnabled": true,
"isOptimizeForAdHocWorkloadsEnabled": true,
"maxDop": 8,
"maxServerMemoryMB": 128,
"minServerMemoryMB": 0
},
"sqlStorageUpdateSettings": {
"diskConfigurationType": "NEW",
"diskCount": 1,
"startingDeviceId": 2
},
"sqlWorkloadTypeUpdateSettings": {
"sqlWorkloadType": "OLTP"
}
},
"sqlImageSku": "Enterprise",
"sqlServerLicenseType": "PAYG",
"storageConfigurationSettings": {
"diskConfigurationType": "NEW",
"enableStorageConfigBlade": true,
"sqlDataSettings": {
"defaultFilePath": "F:\\folderpath\\",
"luns": [
0
],
"useStoragePool": false
},
"sqlLogSettings": {
"defaultFilePath": "G:\\folderpath\\",
"luns": [
1
],
"useStoragePool": false
},
"sqlSystemDbOnDataDisk": true,
"sqlTempDbSettings": {
"dataFileCount": 8,
"dataFileSize": 256,
"dataGrowth": 512,
"defaultFilePath": "D:\\TEMP",
"logFileSize": 256,
"logGrowth": 512,
"luns": [
2
],
"useStoragePool": false
},
"storageWorkloadType": "OLTP"
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_sql_virtual_machine_max.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"assessmentSettings": {
"enable": True,
"runImmediately": True,
"schedule": {
"dayOfWeek": "Sunday",
"enable": True,
"monthlyOccurrence": None,
"startTime": "23:17",
"weeklyInterval": 1,
},
},
"autoBackupSettings": {
"backupScheduleType": "Manual",
"backupSystemDbs": True,
"enable": True,
"enableEncryption": True,
"fullBackupFrequency": "Daily",
"fullBackupStartTime": 6,
"fullBackupWindowHours": 11,
"logBackupFrequency": 10,
"password": "<Password>",
"retentionPeriod": 17,
"storageAccessKey": "<primary storage access key>",
"storageAccountUrl": "https://teststorage.blob.core.windows.net/",
"storageContainerName": "testcontainer",
},
"autoPatchingSettings": {
"dayOfWeek": "Sunday",
"enable": True,
"maintenanceWindowDuration": 60,
"maintenanceWindowStartingHour": 2,
},
"enableAutomaticUpgrade": True,
"keyVaultCredentialSettings": {"enable": False},
"leastPrivilegeMode": "Enabled",
"serverConfigurationsManagementSettings": {
"additionalFeaturesServerConfigurations": {"isRServicesEnabled": False},
"azureAdAuthenticationSettings": {"clientId": "11111111-2222-3333-4444-555555555555"},
"sqlConnectivityUpdateSettings": {
"connectivityType": "PRIVATE",
"port": 1433,
"sqlAuthUpdatePassword": "<password>",
"sqlAuthUpdateUserName": "sqllogin",
},
"sqlInstanceSettings": {
"collation": "SQL_Latin1_General_CP1_CI_AS",
"isIfiEnabled": True,
"isLpimEnabled": True,
"isOptimizeForAdHocWorkloadsEnabled": True,
"maxDop": 8,
"maxServerMemoryMB": 128,
"minServerMemoryMB": 0,
},
"sqlStorageUpdateSettings": {"diskConfigurationType": "NEW", "diskCount": 1, "startingDeviceId": 2},
"sqlWorkloadTypeUpdateSettings": {"sqlWorkloadType": "OLTP"},
},
"sqlImageSku": "Enterprise",
"sqlServerLicenseType": "PAYG",
"storageConfigurationSettings": {
"diskConfigurationType": "NEW",
"enableStorageConfigBlade": True,
"sqlDataSettings": {"defaultFilePath": "F:\\folderpath\\", "luns": [0], "useStoragePool": False},
"sqlLogSettings": {"defaultFilePath": "G:\\folderpath\\", "luns": [1], "useStoragePool": False},
"sqlSystemDbOnDataDisk": True,
"sqlTempDbSettings": {
"dataFileCount": 8,
"dataFileSize": 256,
"dataGrowth": 512,
"defaultFilePath": "D:\\TEMP",
"logFileSize": 256,
"logGrowth": 512,
"luns": [2],
"useStoragePool": False,
},
"storageWorkloadType": "OLTP",
},
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineMAX.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateSqlVirtualMachineMAX.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineWithMaxParameters() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
AssessmentSettings: &armsqlvirtualmachine.AssessmentSettings{
Enable: to.Ptr(true),
RunImmediately: to.Ptr(true),
Schedule: &armsqlvirtualmachine.Schedule{
DayOfWeek: to.Ptr(armsqlvirtualmachine.AssessmentDayOfWeekSunday),
Enable: to.Ptr(true),
StartTime: to.Ptr("23:17"),
WeeklyInterval: to.Ptr[int32](1),
},
},
AutoBackupSettings: &armsqlvirtualmachine.AutoBackupSettings{
BackupScheduleType: to.Ptr(armsqlvirtualmachine.BackupScheduleTypeManual),
BackupSystemDbs: to.Ptr(true),
Enable: to.Ptr(true),
EnableEncryption: to.Ptr(true),
FullBackupFrequency: to.Ptr(armsqlvirtualmachine.FullBackupFrequencyTypeDaily),
FullBackupStartTime: to.Ptr[int32](6),
FullBackupWindowHours: to.Ptr[int32](11),
LogBackupFrequency: to.Ptr[int32](10),
Password: to.Ptr("<Password>"),
RetentionPeriod: to.Ptr[int32](17),
StorageAccessKey: to.Ptr("<primary storage access key>"),
StorageAccountURL: to.Ptr("https://teststorage.blob.core.windows.net/"),
StorageContainerName: to.Ptr("testcontainer"),
},
AutoPatchingSettings: &armsqlvirtualmachine.AutoPatchingSettings{
DayOfWeek: to.Ptr(armsqlvirtualmachine.DayOfWeekSunday),
Enable: to.Ptr(true),
MaintenanceWindowDuration: to.Ptr[int32](60),
MaintenanceWindowStartingHour: to.Ptr[int32](2),
},
EnableAutomaticUpgrade: to.Ptr(true),
KeyVaultCredentialSettings: &armsqlvirtualmachine.KeyVaultCredentialSettings{
Enable: to.Ptr(false),
},
LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
ServerConfigurationsManagementSettings: &armsqlvirtualmachine.ServerConfigurationsManagementSettings{
AdditionalFeaturesServerConfigurations: &armsqlvirtualmachine.AdditionalFeaturesServerConfigurations{
IsRServicesEnabled: to.Ptr(false),
},
AzureAdAuthenticationSettings: &armsqlvirtualmachine.AADAuthenticationSettings{
ClientID: to.Ptr("11111111-2222-3333-4444-555555555555"),
},
SQLConnectivityUpdateSettings: &armsqlvirtualmachine.SQLConnectivityUpdateSettings{
ConnectivityType: to.Ptr(armsqlvirtualmachine.ConnectivityTypePRIVATE),
Port: to.Ptr[int32](1433),
SQLAuthUpdatePassword: to.Ptr("<password>"),
SQLAuthUpdateUserName: to.Ptr("sqllogin"),
},
SQLInstanceSettings: &armsqlvirtualmachine.SQLInstanceSettings{
Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
IsIfiEnabled: to.Ptr(true),
IsLpimEnabled: to.Ptr(true),
IsOptimizeForAdHocWorkloadsEnabled: to.Ptr(true),
MaxDop: to.Ptr[int32](8),
MaxServerMemoryMB: to.Ptr[int32](128),
MinServerMemoryMB: to.Ptr[int32](0),
},
SQLStorageUpdateSettings: &armsqlvirtualmachine.SQLStorageUpdateSettings{
DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
DiskCount: to.Ptr[int32](1),
StartingDeviceID: to.Ptr[int32](2),
},
SQLWorkloadTypeUpdateSettings: &armsqlvirtualmachine.SQLWorkloadTypeUpdateSettings{
SQLWorkloadType: to.Ptr(armsqlvirtualmachine.SQLWorkloadTypeOLTP),
},
},
SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{
DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
EnableStorageConfigBlade: to.Ptr(true),
SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{
DefaultFilePath: to.Ptr("F:\\folderpath\\"),
Luns: []*int32{
to.Ptr[int32](0),
},
UseStoragePool: to.Ptr(false),
},
SQLLogSettings: &armsqlvirtualmachine.SQLStorageSettings{
DefaultFilePath: to.Ptr("G:\\folderpath\\"),
Luns: []*int32{
to.Ptr[int32](1),
},
UseStoragePool: to.Ptr(false),
},
SQLSystemDbOnDataDisk: to.Ptr(true),
SQLTempDbSettings: &armsqlvirtualmachine.SQLTempDbSettings{
DataFileCount: to.Ptr[int32](8),
DataFileSize: to.Ptr[int32](256),
DataGrowth: to.Ptr[int32](512),
DefaultFilePath: to.Ptr("D:\\TEMP"),
LogFileSize: to.Ptr[int32](256),
LogGrowth: to.Ptr[int32](512),
Luns: []*int32{
to.Ptr[int32](2),
},
UseStoragePool: to.Ptr(false),
},
StorageWorkloadType: to.Ptr(armsqlvirtualmachine.StorageWorkloadTypeOLTP),
},
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(true),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeSystemAssigned),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineMAX.json
*/
async function createsOrUpdatesASQLVirtualMachineWithMaxParameters() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
assessmentSettings: {
enable: true,
runImmediately: true,
schedule: { dayOfWeek: "Sunday", enable: true, startTime: "23:17", weeklyInterval: 1 },
},
autoBackupSettings: {
backupScheduleType: "Manual",
backupSystemDbs: true,
enable: true,
enableEncryption: true,
fullBackupFrequency: "Daily",
fullBackupStartTime: 6,
fullBackupWindowHours: 11,
logBackupFrequency: 10,
password: "<Password>",
retentionPeriod: 17,
storageAccessKey: "<primary storage access key>",
storageAccountUrl: "https://teststorage.blob.core.windows.net/",
storageContainerName: "testcontainer",
},
autoPatchingSettings: {
dayOfWeek: "Sunday",
enable: true,
maintenanceWindowDuration: 60,
maintenanceWindowStartingHour: 2,
},
enableAutomaticUpgrade: true,
keyVaultCredentialSettings: { enable: false },
leastPrivilegeMode: "Enabled",
serverConfigurationsManagementSettings: {
additionalFeaturesServerConfigurations: { isRServicesEnabled: false },
azureAdAuthenticationSettings: { clientId: "11111111-2222-3333-4444-555555555555" },
sqlConnectivityUpdateSettings: {
connectivityType: "PRIVATE",
port: 1433,
sqlAuthUpdatePassword: "<password>",
sqlAuthUpdateUserName: "sqllogin",
},
sqlInstanceSettings: {
collation: "SQL_Latin1_General_CP1_CI_AS",
isIfiEnabled: true,
isLpimEnabled: true,
isOptimizeForAdHocWorkloadsEnabled: true,
maxDop: 8,
maxServerMemoryMB: 128,
minServerMemoryMB: 0,
},
sqlStorageUpdateSettings: { diskConfigurationType: "NEW", diskCount: 1, startingDeviceId: 2 },
sqlWorkloadTypeUpdateSettings: { sqlWorkloadType: "OLTP" },
},
sqlImageSku: "Enterprise",
sqlServerLicenseType: "PAYG",
storageConfigurationSettings: {
diskConfigurationType: "NEW",
enableStorageConfigBlade: true,
sqlDataSettings: { defaultFilePath: "F:\\folderpath\\", luns: [0], useStoragePool: false },
sqlLogSettings: { defaultFilePath: "G:\\folderpath\\", luns: [1], useStoragePool: false },
sqlSystemDbOnDataDisk: true,
sqlTempDbSettings: {
dataFileCount: 8,
dataFileSize: 256,
dataGrowth: 512,
defaultFilePath: "D:\\TEMP",
logFileSize: 256,
logGrowth: 512,
luns: [2],
useStoragePool: false,
},
storageWorkloadType: "OLTP",
},
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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": "WU",
"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"
}
}
{
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
Creates or updates a SQL virtual machine with min parameters.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm?api-version=2023-10-01
{
"location": "northeurope",
"properties": {
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sqlvirtualmachine import SqlVirtualMachineManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sqlvirtualmachine
# USAGE
python create_or_update_sql_virtual_machine_min.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlVirtualMachineManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.sql_virtual_machines.begin_create_or_update(
resource_group_name="testrg",
sql_virtual_machine_name="testvm",
parameters={
"location": "northeurope",
"properties": {
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
},
},
).result()
print(response)
# x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineMIN.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsqlvirtualmachine_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)
// Generated from example definition: 2023-10-01/CreateOrUpdateSqlVirtualMachineMIN.json
func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineWithMinParameters() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsqlvirtualmachine.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
Location: to.Ptr("northeurope"),
Properties: &armsqlvirtualmachine.Properties{
VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsqlvirtualmachine.SQLVirtualMachinesClientCreateOrUpdateResponse{
// SQLVirtualMachine: armsqlvirtualmachine.SQLVirtualMachine{
// Name: to.Ptr("testvm"),
// Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
// Location: to.Ptr("northeurope"),
// Properties: &armsqlvirtualmachine.Properties{
// AdditionalVMPatch: to.Ptr(armsqlvirtualmachine.AdditionalOsPatchWU),
// EnableAutomaticUpgrade: to.Ptr(true),
// LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
// OSType: to.Ptr(armsqlvirtualmachine.OsTypeWindows),
// ProvisioningState: to.Ptr("Updating"),
// SQLImageOffer: to.Ptr("SQL2022-WS2022"),
// SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
// SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
// SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
// VirtualMachineIdentitySettings: &armsqlvirtualmachine.VirtualMachineIdentity{
// Type: to.Ptr(armsqlvirtualmachine.VMIdentityTypeSystemAssigned),
// },
// VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlVirtualMachineManagementClient } = require("@azure/arm-sqlvirtualmachine");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a SQL virtual machine.
*
* @summary creates or updates a SQL virtual machine.
* x-ms-original-file: 2023-10-01/CreateOrUpdateSqlVirtualMachineMIN.json
*/
async function createsOrUpdatesASQLVirtualMachineWithMinParameters() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlVirtualMachineManagementClient(credential, subscriptionId);
const result = await client.sqlVirtualMachines.createOrUpdate("testrg", "testvm", {
location: "northeurope",
virtualMachineResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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": "WU",
"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"
}
}
{
"name": "testvm",
"type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm",
"location": "northeurope",
"properties": {
"enableAutomaticUpgrade": true,
"leastPrivilegeMode": "NotSet",
"provisioningState": "Provisioning",
"sqlImageSku": "Unknown",
"sqlServerLicenseType": "PAYG",
"virtualMachineResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"
}
}
Definitions
AADAuthenticationSettings
Object
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
Object
Additional SQL Server feature settings.
| Name |
Type |
Description |
|
isRServicesEnabled
|
boolean
|
Enable or disable R services (SQL 2016 onwards).
|
AdditionalOsPatch
Enumeration
Additional VM Patching solution enabled on the Virtual Machine
| Value |
Description |
|
WU
|
|
|
WUMU
|
|
|
WSUS
|
|
AdditionalVmPatch
Enumeration
Additional Patch to be enable or enabled on the SQL Virtual Machine.
| Value |
Description |
|
NotSet
|
|
|
MicrosoftUpdate
|
|
AssessmentDayOfWeek
Enumeration
Day of the week to run assessment.
| Value |
Description |
|
Monday
|
|
|
Tuesday
|
|
|
Wednesday
|
|
|
Thursday
|
|
|
Friday
|
|
|
Saturday
|
|
|
Sunday
|
|
AssessmentSettings
Object
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
Enumeration
| Value |
Description |
|
Monday
|
|
|
Tuesday
|
|
|
Wednesday
|
|
|
Thursday
|
|
|
Friday
|
|
|
Saturday
|
|
|
Sunday
|
|
AutoBackupSettings
Object
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
Object
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
Enumeration
Backup schedule type.
| Value |
Description |
|
Manual
|
|
|
Automated
|
|
ConnectivityType
Enumeration
SQL Server connectivity option.
| Value |
Description |
|
LOCAL
|
|
|
PRIVATE
|
|
|
PUBLIC
|
|
createdByType
Enumeration
The type of identity that created the resource.
| Value |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DayOfWeek
Enumeration
Day of week to apply the patch on.
| Value |
Description |
|
Everyday
|
|
|
Monday
|
|
|
Tuesday
|
|
|
Wednesday
|
|
|
Thursday
|
|
|
Friday
|
|
|
Saturday
|
|
|
Sunday
|
|
DiskConfigurationType
Enumeration
Disk configuration to apply to SQL Server.
| Value |
Description |
|
NEW
|
|
|
EXTEND
|
|
|
ADD
|
|
ErrorAdditionalInfo
Object
The resource management error additional info.
| Name |
Type |
Description |
|
info
|
object
|
The additional info.
|
|
type
|
string
|
The additional info type.
|
ErrorDetail
Object
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
Object
Error response
| Name |
Type |
Description |
|
error
|
ErrorDetail
|
The error object.
|
FullBackupFrequencyType
Enumeration
Frequency of full backups. In both cases, full backups begin during the next scheduled time window.
| Value |
Description |
|
Daily
|
|
|
Weekly
|
|
IdentityType
Enumeration
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
Object
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
Enumeration
SQL IaaS Agent least privilege mode.
| Value |
Description |
|
Enabled
|
|
|
NotSet
|
|
OsType
Enumeration
Operating System of the current SQL Virtual Machine.
| Value |
Description |
|
Windows
|
|
|
Linux
|
|
ResourceIdentity
Object
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
Object
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
Object
Set the connectivity, storage and workload settings.
SqlConnectivityUpdateSettings
Object
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
Enumeration
SQL Server edition type.
| Value |
Description |
|
Developer
|
|
|
Express
|
|
|
Standard
|
|
|
Enterprise
|
|
|
Web
|
|
SQLInstanceSettings
Object
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
Enumeration
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
Enumeration
SQL Server license type.
| Value |
Description |
|
PAYG
|
|
|
AHUB
|
|
|
DR
|
|
SQLStorageSettings
Object
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
Object
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
Object
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
Object
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"
|
SqlWorkloadType
Enumeration
SQL Server workload type.
| Value |
Description |
|
GENERAL
|
|
|
OLTP
|
|
|
DW
|
|
SqlWorkloadTypeUpdateSettings
Object
Set workload type to optimize storage for SQL Server.
| Name |
Type |
Description |
|
sqlWorkloadType
|
SqlWorkloadType
|
SQL Server workload type.
|
StorageConfigurationSettings
Object
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
Enumeration
Storage workload type.
| Value |
Description |
|
GENERAL
|
|
|
OLTP
|
|
|
DW
|
|
systemData
Object
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
Object
SQL VM Troubleshooting additional properties.
TroubleshootingScenario
Enumeration
SQL VM troubleshooting scenario.
| Value |
Description |
|
UnhealthyReplica
|
|
TroubleshootingStatus
Object
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
Object
SQL VM Troubleshoot UnhealthyReplica scenario information.
| Name |
Type |
Description |
|
availabilityGroupName
|
string
|
The name of the availability group
|
VirtualMachineIdentity
Object
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
Enumeration
Identity type of the virtual machine. Specify None to opt-out of Managed Identities.
| Value |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
WsfcDomainCredentials
Object
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.
|