Sql Virtual Machine Groups - Create Or Update

Creates or updates a SQL virtual machine group.

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

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

sqlVirtualMachineGroupName
path True

string

Name of the SQL virtual machine group.

subscriptionId
path True

string

Subscription ID that identifies an Azure subscription.

api-version
query True

string

API version to use for the request.

Request Body

Name Required Type Description
location True

string

Resource location.

properties.sqlImageOffer

string

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

properties.sqlImageSku

SqlVmGroupImageSku

SQL image sku.

properties.wsfcDomainProfile

WsfcDomainProfile

Cluster Active Directory domain profile.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

SqlVirtualMachineGroup

Successfully updated the SQL virtual machine group.

201 Created

SqlVirtualMachineGroup

Successfully created the SQL virtual machine group.

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 RPGenericUser - User Failure when calling other Resource Provider.

  • 400 RPResponseMissingAsyncOperationHeader - Response is missing Async operation header information

  • 400 InvalidArgument - Invalid argument '{0}'.

  • 400 ArgumentNotInRange - Argument '{0}' not in range.

  • 400 ResourceNotProvisioned - As the resource: {0} is not in a provisioned state, the request cannot be proceeded forward

  • 400 CRPNotAllowedOperation - Operation cannot be completed due to the following error: {0}

  • 400 AadAppDisabled - Microsoft AAD app SQLVMResourceProviderAuth ({0}) is disabled in your tenant.

  • 400 InternalAPIAccessDenied - Internal API Access denied. App Id {0} is not valid to use this API.

  • 400 InvalidSQLAuthPasswordLength - SQL auth password should not be greater than 128 characters

  • 400 InvalidRgResourceId - Invalid Resourcegroup resource id specified.

  • 400 InvalidParameterValue - An invalid value was given to parameter.

  • 400 SqlVmGroupUpdateFailVmAttached - SQL virtual machine group cannot be updated as it has attached a SQL virtual machine.

  • 400 InvalidSqlImageOffer - Provided SQL image offer is invalid.

  • 400 InvalidSqlSku - Provided SQL sku is invalid. Sql VM Group allowed values are Enterprise or Developer.

  • 400 OuPathAndDomainMismatch - OU path is not within the domain provided.

  • 400 InvalidAccountNameFormat - Account name format is invalid.

  • 400 CloudWitnessUnsupported - For Windows Server 2012R2 setup cloud witness is not allowed.

  • 400 FileShareWitnessDisAllowed - For Windows Server 2016 and beyond setup, file share witness is not allowed.

  • 400 InvalidStorageAccountUrl - Invalid storage account url.

  • 400 SqlVmGroupNameTooLong - SQL virtual machine group name cannot exceed 15 characters.

  • 400 InvalidSqlVmGroupName - Invalid SQL virtual machine group name.

  • 400 SqlVmGroupNotEmpty - SQL virtual machine group is not empty.

  • 400 SqlVmGroupUpdateNotAllowed - Update to SQL virtual machine group is not allowed.

  • 403 AccessDenied - Access denied.

  • 404 SubscriptionDoesNotExist - Subscription id does not exist.

  • 404 ResourceDoesNotExist - Resource does not exist.

  • 404 RPOperationNotFound - Operation not found

  • 404 OperationIdNotFound - Operation id could not be found.

  • 404 OperationTypeNotFound - Operation Type not found.

  • 404 ResourceNotFound - The requested resource was not found.

  • 404 SubscriptionDoesNotHaveSqlVMGroupInResourceGroup - Subscription does not have SQL virtual machine group in resource group.

  • 409 OperationInProgress - Operation in progress on resource already.

  • 409 OperationCanceled - Operation Cancelled.

  • 409 ResourceAlreadyExists - Resource already exists.

  • 409 LBGenericErrors - LB operation failed

  • 409 NICGenericError - NIC operation failed

  • 409 SqlExtensionNotInstalled - SQL extension not installed.

  • 409 RPPluginSubstatusMissing - RP plugin substatus missing

  • 409 MissingMoveResources - Cannot move resources(s) because some resources are missing in the request.

  • 409 ResourceExists - There was an internal error in cleaning up of resources.

  • 409 SubscriptionOperationInProgress - An operation on subscription is already in progress

  • 429 SqlVmGroupGmsaNotAllowed - GMSA account is not supported yet.

  • 429 SqlVmGroupGmsaInfoInvalid - GMSA info such as SqlServiceAccount is not valid.

  • 429 TooManyRequestsReceived - Request throttled due to too many requests.

  • 429 ArgumentMissingForSetup - Argument is missing for setup. Please provide a value for the argument.

  • 429 MultisubnetOperationNotAllowed - Multi subnet HA setup operation is not allowed.

  • 500 UnExpectedErrorOccurred - Unexpected error occurred.

  • 500 OperationTimeout - Operation timed out.

  • 500 RPGenericSystem - System Failure when calling other Resource Provider.

  • 500 StorageAccountUnexpectedError - Unexpected error for storage account.

  • 500 SqlVmEntityNotFound - SQL VM entity not found.

  • 500 RestoreJobEntityNotFound - Restore job entity not found.

  • 500 RpPluginSubstatusHAStatusMissing - Resource provider plugin substatus is missing HA status.

Examples

Creates or updates a SQL virtual machine group.

Sample Request

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

{
  "location": "northeurope",
  "tags": {
    "mytag": "myval"
  },
  "properties": {
    "sqlImageOffer": "SQL2016-WS2016",
    "sqlImageSku": "Enterprise",
    "wsfcDomainProfile": {
      "domainFqdn": "testdomain.com",
      "ouPath": "OU=WSCluster,DC=testdomain,DC=com",
      "clusterBootstrapAccount": "testrpadmin",
      "clusterOperatorAccount": "testrp@testdomain.com",
      "sqlServiceAccount": "sqlservice@testdomain.com",
      "isSqlServiceAccountGmsa": false,
      "storageAccountUrl": "https://storgact.blob.core.windows.net/",
      "storageAccountPrimaryKey": "<primary storage access key>",
      "clusterSubnetType": "MultiSubnet"
    }
  }
}

Sample Response

{
  "properties": {
    "provisioningState": "UpdatingDomainful",
    "sqlImageOffer": "SQL2016-WS2016",
    "sqlImageSku": "Enterprise",
    "wsfcDomainProfile": {
      "domainFqdn": "testdomain.com",
      "ouPath": "OU=WSCluster,DC=testdomain,DC=com",
      "clusterBootstrapAccount": "testrpadmin",
      "clusterOperatorAccount": "testrp@testdomain.com",
      "sqlServiceAccount": "sqlservice@testdomain.com",
      "isSqlServiceAccountGmsa": false,
      "storageAccountUrl": "https://storgact.blob.core.windows.net/",
      "clusterSubnetType": "MultiSubnet"
    }
  },
  "location": "northeurope",
  "tags": {
    "mytag": "myval"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
  "name": "testvmgroup",
  "type": "Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"
}
{
  "properties": {
    "provisioningState": "ProvisioningDomainful",
    "sqlImageOffer": "SQL2016-WS2016",
    "sqlImageSku": "Enterprise",
    "wsfcDomainProfile": {
      "domainFqdn": "testdomain.com",
      "ouPath": "OU=WSCluster,DC=testdomain,DC=com",
      "clusterBootstrapAccount": "testrpadmin",
      "clusterOperatorAccount": "testrp@testdomain.com",
      "sqlServiceAccount": "sqlservice@testdomain.com",
      "isSqlServiceAccountGmsa": false,
      "storageAccountUrl": "https://storgact.blob.core.windows.net/",
      "clusterSubnetType": "MultiSubnet"
    }
  },
  "location": "northeurope",
  "tags": {
    "mytag": "myval"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup",
  "name": "testvmgroup",
  "type": "Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"
}

Definitions

Name Description
ClusterConfiguration

Cluster type.

ClusterManagerType

Type of cluster manager: Windows Server Failover Cluster (WSFC), implied by the scale type of the group and the OS type.

ClusterSubnetType

Cluster subnet type.

createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ScaleType

Scale type.

SqlVirtualMachineGroup

A SQL virtual machine group.

SqlVmGroupImageSku

SQL image sku.

systemData

Metadata pertaining to creation and last modification of the resource.

WsfcDomainProfile

Active Directory account details to operate Windows Server Failover Cluster.

ClusterConfiguration

Cluster type.

Name Type Description
Domainful

string

ClusterManagerType

Type of cluster manager: Windows Server Failover Cluster (WSFC), implied by the scale type of the group and the OS type.

Name Type Description
WSFC

string

ClusterSubnetType

Cluster subnet type.

Name Type Description
MultiSubnet

string

SingleSubnet

string

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ScaleType

Scale type.

Name Type Description
HA

string

SqlVirtualMachineGroup

A SQL virtual machine group.

Name Type Description
id

string

Resource ID.

location

string

Resource location.

name

string

Resource name.

properties.clusterConfiguration

ClusterConfiguration

Cluster type.

properties.clusterManagerType

ClusterManagerType

Type of cluster manager: Windows Server Failover Cluster (WSFC), implied by the scale type of the group and the OS type.

properties.provisioningState

string

Provisioning state to track the async operation status.

properties.scaleType

ScaleType

Scale type.

properties.sqlImageOffer

string

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

properties.sqlImageSku

SqlVmGroupImageSku

SQL image sku.

properties.wsfcDomainProfile

WsfcDomainProfile

Cluster Active Directory domain profile.

systemData

systemData

Metadata pertaining to creation and last modification of the resource.

tags

object

Resource tags.

type

string

Resource type.

SqlVmGroupImageSku

SQL image sku.

Name Type Description
Developer

string

Enterprise

string

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

WsfcDomainProfile

Active Directory account details to operate Windows Server Failover Cluster.

Name Type Description
clusterBootstrapAccount

string

Account name used for creating cluster (at minimum needs permissions to 'Create Computer Objects' in domain).

clusterOperatorAccount

string

Account name used for operating cluster i.e. will be part of administrators group on all the participating virtual machines in the cluster.

clusterSubnetType

ClusterSubnetType

Cluster subnet type.

domainFqdn

string

Fully qualified name of the domain.

fileShareWitnessPath

string

Optional path for fileshare witness.

isSqlServiceAccountGmsa

boolean

The flag to check if SQL service account is GMSA.

ouPath

string

Organizational Unit path in which the nodes and cluster will be present.

sqlServiceAccount

string

Account name under which SQL service will run on all participating SQL virtual machines in the cluster.

storageAccountPrimaryKey

string

Primary key of the witness storage account.

storageAccountUrl

string

Fully qualified ARM resource id of the witness storage account.