Share via


Distributed Availability Groups - Failover

Performs requested failover type in this distributed availability group.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/failover?api-version=2023-08-01

URI Parameters

Name In Required Type Description
distributedAvailabilityGroupName
path True

string

minLength: 1
maxLength: 128
pattern: ^[#a-zA-Z_][\w@#$]*$

The distributed availability group name.

managedInstanceName
path True

string

minLength: 1
maxLength: 63
pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$

The name of the managed instance.

resourceGroupName
path True

string

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

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Required Type Description
failoverType True

FailoverType

The failover type, can be ForcedAllowDataLoss or Planned.

Responses

Name Type Description
200 OK

DistributedAvailabilityGroup

Successfully initiated the distributed availability group failover.

202 Accepted

Accepted request for failing over the distributed availability group.

Headers

Location: string

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 InvalidDistributedAvailabilityGroupFailoverRequest - Distributed Availability Group Failover request body is empty or invalid.

  • 400 InvalidDistributedAvailabilityGroupFailoverInstanceRole - Planned failover can be executed on a link in the primary role only. Current state of the specified link is secondary.

  • 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state

  • 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state

  • 400 UnspecifiedTargetEditionAndTrueGPV2NotAllowedInCreateOfMI - Combination of unspecified target edition (sku.name/sku.tier parameters) and the value TRUE for the isGeneralPurposeV2 parameter is not allowed in the create operation.

  • 400 UnspecifiedTargetEditionAndTrueGPV2NotAllowedInUpdateOfGPV1MI - Combination of unspecified target edition (sku.name/sku.tier parameters) and the value TRUE for the isGeneralPurposeV2 parameter is not allowed in the update operation of General Purpose V1 Managed Instance.

  • 400 UnspecifiedTargetEditionAndFalseGPV2NotAllowedInUpdateOfGPV2MI - Combination of unspecified target edition (sku.name/sku.tier parameters) and the value FALSE for the isGeneralPurposeV2 parameter is not allowed in the update operation of General Purpose V2 Managed Instance.

  • 400 NameAlreadyExists - The provided name already exists.

  • 400 GPTargetEditionAndUnspecifiedGPV2NotAllowedInUpdateOFGPV2MI - Combination of General Purpose target edition (sku.name/sku.tier parameters) and unspecified value for the isGeneralPurposeV2 parameter is not allowed in the update operation of General Purpose V2 Managed Instance.

  • 400 InvalidCollation - Invalid collation.

  • 400 ProvisioningDisabled - Displays error message from resources operation authorizer as is, without changes

  • 400 BCTargetEditionAndSpecifiedGPV2ParamNotAllowedInCreateUpdateOfMI - Combination of Business Critical target edition (sku.name/sku.tier parameters) with a specified isGeneralPurposeV2 parameter is not allowed in the create/update operation.

  • 400 UnspecifiedTargetEditionAndSpecifiedGPV2ParamNotAllowedInUpdateOfBCMI - Combination of unspecified target edition (sku.name/sku.tier parameters) with a specified isGeneralPurposeV2 parameter is not allowed in the update operation of Business Critical Managed Instance.

  • 400 RegionDoesNotAllowProvisioning - The selected location is not accepting new Windows Azure SQL Database servers. This may change at a later time.

  • 400 MemorySizeInGBNotSupported - Memory size in GB parameter is not allowed in the instance create/update operation.

  • 400 MemorySizeInGBNotSupportedForSpecifiedEdition - Memory size in GB parameter is not allowed in the instance create/update operation for the specified service tier or hardware generation.

  • 400 InvalidSubnetForGPV2Edition - General Purpose v2 edition of Managed Instance is not compatible with the specified subnet. Target subnet must be either empty, or all instances in it must run with November 2022 Feature Wave.

  • 400 MemorySizeInGBInvalidLimit - The specified memory value is invalid. Please ensure the memory size in GB is within the allowable range of 28 to 870 and corresponds appropriately to the number of vCores and service tier. The available memory sizes for the selected vCores and service tier are {0}. For details around resource limits visit: https://go.microsoft.com/fwlink/?linkid=2293407

  • 400 UnableToResolveRemoteServer - The remote partner server name could not be resolved due to an invalid server name or DNS connectivity issues.

  • 400 ManagedInstanceUpdateSloGPv2PerDatabaseFileLimitExceeded - The operation could not be completed because there is at least one database whose number of files is exceeding the limit of {0} files per database on General Purpose v2 edition.

  • 400 NextGenGPNotSupportedForCmwCustomers - Next-Gen General Purpose edition of Managed Instance does not support Custom Maintenance Window.

  • 400 HkCannotSwitchToInactive - The database cannot proceed with pricing-tier update as it has memory-optimized objects. Please drop such objects and try again.

  • 400 TokenTooLong - The provided token is too long.

  • 400 ManagedInstanceFreemiumNotAvailableForInputParameters - Managed instance creation or update executed with SLO that is not allowed for freemium.

  • 400 ManagedInstanceFreemiumNotAvailableOnRegion - Creation of a freemium managed instance on a region that is not allowlisted for freemium.

  • 400 ManagementServiceSubnetMaintenanceInProgress - User tried to initiate managed instance create/update while incompatible maintenance is in progress.

  • 400 ManagedInstanceFreemiumNotAvailableForSubscription - Freemium is not enabled for this subscription type.

  • 400 ManagedInstanceInvalidEditionForInstancePool - User tried to select invalid service tier for managed instance inside an existing instance pool.

  • 400 ManagedInstanceInvalidSubnetForInstancePool - User tried to select invalid subnet for managed instance inside an existing instance pool.

  • 400 CloudLifterUnsupportedFeature - The functionality is not available on the Managed Instance at this time.

  • 400 ManagedInstanceSloUpdateFailed - SLO '{0}' operation cannot succeed as the memory usage of '{1}' exceeds the quota.

  • 400 OperationCanNotStartDueToMiLink - The '{0}' operation cannot be completed as there exists a database in a process of creation through Managed Instance link. Please wait for the link creation to complete, or delete the link, and retry the operation again.

  • 400 ManagedInstanceInvalidHardwareFamilyForInstancePool - User tried to select invalid hardware family for managed instance inside an existing instance pool.

  • 400 ManagedInstanceInvalidLicenseTypeForInstancePool - User tried to select invalid license type for managed instance inside an existing instance pool.

  • 400 ManagedInstanceLocalStorageUpdateSloDisabled - Update SLO for managed instances with local storage is not supported yet.

  • 400 ManagedInstanceUpdateSloFromVersionlessToVersionedNotAllowed - Changing the database format from '{0}' to '{1}' is not supported. Check the database format property value specified and visit https://aka.ms/sqlmidatabaseformat for more details.

  • 400 ManagedInstanceUpdateSloFromNewerToOlderVersionEditionNotAllowed - Changing the database format from '{0}' to '{1}' is not supported. Check the database format property value specified and visit https://aka.ms/sqlmidatabaseformat for more details.

  • 400 InvalidSubnetResourceId - The provided subnet resource ID for the managed instance create or update is invalid.

  • 400 ManagedInstanceUpdateSloFromVersionedToVersionlessWorkerCLNotAllowed - Changing the database format is not supported for this managed instance. Check the database format property value specified and visit https://aka.ms/sqlmi-fwnov2022 for more details.

  • 400 ManagedInstanceVersionEditionParameterNotAllowedForUsing - Specifying the database format property value is not supported at this time.

  • 400 ManagedInstanceFreemiumInvalidArchitecture - A freemium instance can not be created in the specified subnet '(0)'.

  • 400 ManagedInstanceWithGeoDRMoveToInstancePoolNotAllowed - Customer has attempted to move a standalone Managed Instance with an existing auto-failover group configured into an instance pool, which is not supported. Only standalone instances without existing auto-failover groups configured can be moved to instance pools.

  • 400 ManagedInstanceZoneRedudantFeatureTemporarilyDisabledPerRegion - Creation of ZoneRedundant SQL MI is temporarily disabled on this region. You can create Zone Redundant SQL Managed Instances in many other regions in Azure. https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/high-availability-sla?view=azuresql-mi#zone-redundant-availability.

  • 400 VnetInWrongRegion - Virtual network is in wrong region.

  • 400 ManagedInstanceZoneRedudantFeatureTemporarilyDisabledPerHardwareGeneration - Creation of ZoneRedundant SQL MI is temporarily disabled for this hardware generation on this region. You can create Zone Redundant SQL Managed Instances with different hardware generation on this region or many other regions in Azure. https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/high-availability-sla?view=azuresql-mi#zone-redundant-availability.

  • 400 AlterDbDeactivatedNotSupported - Database Operation failed for Server '{0}', Database '{1}' due to unexpected delay. Please try again.

  • 400 ManagedInstanceUpdateSloGeoPrimaryWithNewerVersionEditionThanSecondary - Database format change must be performed on the secondary instance of the failover group first. See https://go.microsoft.com/fwlink/?linkid=2251601 for more details.

  • 400 ManagedInstanceFreemiumInstanceAlreadyExists - Only one free SQL Managed Instance is allowed per subscription.

  • 400 ManagementServiceGeodrSecondaryDatabaseInCreation - The '{0}' operation cannot be completed as there exists a database in a process of creation through failover group deployment. Please wait for the failover group deployment to complete, or alternatively delete the failover group and retry the operation again.

  • 400 VnetAddressRangeError - Virtual network address range is invalid.

  • 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported.

  • 400 ManagedInstanceConversionRegularToFreemiumNotAllowed - User tried converting a Regular SQL Managed Instance to Free SQL Managed Instance.

  • 400 ManagedInstanceConversionFreemiumToRegularAndUpdateSLOWhileStoppedNotAllowed - User tried converting a Free SQL Managed Instance to Regular SQL Managed Instance and Update SLO in same request, while Instance is stopped.

  • 400 ManagedInstanceMaintenanceWindowChangeNotAllowedWhenInInstancePool - Maintenance window is set at instance pool level and cannot be set individually per pooled instance.

  • 400 ManagedInstanceMoveToInstancePoolExceedsDbCountLimit - Cannot move the instance into the pool due to pool database count limit.

  • 400 ManagedInstancePoolZoneRedundancyNotSupported - Cannot move a zone-redundant instance into the pool as zone-redundancy is not supported in pools.

  • 400 VnetConfigIsNotAllowed - Virtual network configuration is not allowed.

  • 400 DeploymentIntoPrivateSubnetsNotAllowed - Deploying managed instances and instance pools into private subnets is not supported.

  • 400 ManagedInstanceDeprecatedMinimalTlsVersionLowerThan12DuringCreateUpdate - Operation '{0}' could not be completed because the minimum TLS version required is 1.2 or higher. Earlier versions of TLS are no longer supported as they are considered deprecated.

  • 400 InstanceFailoverGroupDoesNotExist - Failover group does not exist on a server.

  • 400 MaintenanceWindowMismatchBetweenInstanceAndInstancePool - Instance maintenance window must be set to match instance pool maintenance window.

  • 400 ManagedInstanceClassicVnetNotSupported - Managed Instance cannot be joined to a classic virtual network.

  • 400 ManagedInstanceMinTlsVersionGreaterThanMaxAllowedVersion - Operation '{0}' could not be completed because the minimum TLS version parameter is higher than max allowed.

  • 400 VnetConfigHasNsg - User tried to inject Managed Server subnet with Network Security Groups.

  • 400 VnetConfigHasNoUdr - User tried to inject Managed Server subnet without default User Defined Route Table.

  • 400 VnetConfigHasInvalidUdr - User tried to inject Managed Server subnet with invalid User Defined Route Table.

  • 400 VnetConfigHasInvalidDns - User tried to inject Managed Server subnet with invalid custom DNS.

  • 400 VnetConfigHasServiceEndpoints - User tried to inject Managed Server subnet with service endpoints.

  • 400 VnetSubnetIsInUse - User tried to inject Managed Server subnet that is not empty.

  • 400 VnetSubnetIsLocked - User tried to inject Managed Server subnet that is in locked scope.

  • 400 VnetSubnetIsGateway - User tried to inject Managed Server subnet that is Gateway subnet.

  • 400 VnetSubnetIsUnknown - User tried to inject Managed Server subnet that does not exist.

  • 400 VnetSubnetConflictWithIntendedPolicy - User tried to inject Managed Server subnet that has a conflict with IntendedPolicy.

  • 400 ManagedInstanceInvalidEditionForSku - The specified edition {0} is not consistent with the specified SKU {1}.

  • 400 ManagedInstanceInvalidLicenseType - The specified license type {0} is not valid.

  • 400 ManagedInstanceUpdateSloInProgress - "The operation could not be completed because a service tier change is in progress for managed instance '{0}.' Please wait for the operation in progress to complete and try again."

  • 400 VnetResourceNotFound - Resource not found: '{0}'.

  • 400 InstanceCollationUpdateNotSupported - User cannot change instance collation on Managed Instance.

  • 400 CreateManagedInstanceWithNonDefaultCollationNotSupported - User can create a Managed Instance only with collation 'SQL_Latin1_General_CP1_CI_AS'.

  • 400 ManagedInstanceOperationInProgress - The operation could not be completed because {0} operation is in progress. Please wait for the operation in progress to complete and try again.

  • 400 ManagedInstanceExceedMaxAzureStorage - The operation could not be completed because total allocated storage size for General Purpose instance would exceed {0}. Please reduce the number of database files and retry operation.

  • 400 ManagedInstanceHasGeoReplica - The operation could not be completed because instance has configured geo replicated secondary instance.

  • 400 InvalidDnsZone - The operation has failed because you are attempting to deploy managed instance as a geo-replication secondary to the subnet {0} in which there already exists a managed instance. Deploying managed instance as a geo-replication secondary is supported only in cases when managed instance is the first instance deployed in a subnet. Consider deploying managed instance as a geo-replication secondary to a different subnet in which there are no existing managed instances, or if deploying to a subnet with existing managed instance disable the geo-replication option.

  • 400 ManagedInstanceInvalidStorageSizeLessThenCurrentSizeUsed - Invalid storage size: Storage size limit ({0} GB) is less that current storage used ({1} GB). Please specify higher storage size limit.

  • 400 InvalidTimezone - Invalid timezone.

  • 400 InstanceTimezoneUpdateNotSupported - Instance timezone update not supported.

  • 400 CreateManagedInstanceWithNonDefaultTimezoneNotSupported - Create Managed Instance with non-default timezone not supported.

  • 400 ManagedInstanceIpAddressRangeLimit - Cannot perform creation/scaling of the managed instance as there are not enough available IP addresses in the subnet for performing the operation.

  • 400 VnetDelegationNotAllowed - User tried to inject Managed Server to subnet which is delegated.

  • 400 SubnetHasResourcesOfDifferentType - User tried to create MI in subnet that has resources of different type.

  • 400 UpdateManagedServerWithMaintenanceWindowNotAllowed - Update of Managed Instance with maintenance window settings is not allowed.

  • 400 OperationNotAllowedInCurrentGeodrConfiguration - The operation is not allowed because the current geo-replication configuration does not allow this combination of {0}. Change the setting on the geo-replication partner before applying the change on this instance.

  • 400 VnetPrepareNIPFailed - User tried to prepare subnet that has a conflict with NetworkIntentPolicy.

  • 400 ManagedInstanceDeprecatedHardwareFamily - Changing the hardware generation to deprecated {0} generation is not possible.

  • 400 ManagedInstanceBackupStorageTypeNotSupported - Backup storage type parameter is not allowed in the instance update operation.

  • 400 EmptyPDCInvalidDnsZone - This managed instance cannot be deployed because its DNS-zone does not match the DNS-prefix of its intended virtual cluster for subnet {0}. Although this virtual cluster is empty, its DNS-prefix cannot be changed. Empty virtual clusters will be automatically removed after several hours. Consider waiting for this virtual cluster to expire or manually deleting this virtual cluster and then creating the managed instance.

  • 400 MissingIdentityId - No user assigned identity is provided when the identity type is set to UserAssigned

  • 400 InvalidPrimaryIdentityId - User provides a value for PrimaryUserIdentityId but the same is not listed in the IdentityId parameter

  • 400 ManagedInstanceZoneRedudantFeatureNotSupported - ZoneRedundant feature is not supported for the selected service tier. For more details visit aka.ms/sqlmi-service-tier-characteristics.

  • 400 ManagedInstanceZoneRedudantFeatureCantBeEnabled - Enabling zoneRedundant feature is not possible once managed instance is created. For more details visit aka.ms/sqlmi-high-availability.

  • 400 ManagedInstanceZoneRedudantFeatureCantBeDisabled - Disabling zoneRedundant feature is not possible once managed instance is created. For more details visit aka.ms/sqlmi-high-availability.

  • 400 UmiMissingAkvPermissions - PrimaryUserAssignedIdentityId provided by user does not have access to KeyId provided

  • 400 MissingPrimaryIdentity - PrimaryUserAssignedIdentityId provided by user does not have access to KeyId provided

  • 400 SubnetIdCantBeUpdated - Changing managed instance subnet is not supported operation. Please remove this parameter from the request.

  • 400 MigrationToAnotherVNetNotSupported - Selected subnet is in another Virtual Network. Moving managed instance to another Virtual Network is not possible. Please provide subnet from Virtual Network {0}.

  • 400 MigrationToSubnetWithDifferentDnsZoneNotSupported - Provided subnet is having different DNS zone from the current. Changing instance DNS zone is not supported. Please provide subnet with same DNS zone, create a new subnet or provide empty one.

  • 400 MigrationToGen4SubnetNotSupported - It is not possible to update subnet while running on Gen4 hardware as it is being deprecated. Please upgrade your hardware from Gen4 to Gen5 as part of the changing managed instance subnet operation by specifying both parameters at the same time: destination subnet and hardware generation.

  • 400 PrimaryIdentityMissingPermissionForKeyId - KeyId is provided by user during create but PrimaryUserAssignedIdentityId is not provided in the API call

  • 400 InvalidIdentityTypeForKeyId - KeyId is provided by user during create but identity type is not set to 'UserAssigned'

  • 400 ServerNotFound - The requested server was not found.

  • 400 ManagedInstanceFileExceededMaxAzureStorageFileSizeLimit - The operation could not be completed because some of the database files are exceeding maximum General Purpose file size limit of {0} GB.

  • 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state

  • 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state

  • 400 InstancePoolNotEnoughCapacity - An instance pool does not have enough capacity

  • 400 SourceAndTargetSubnetsMustBeVnetPeered - Subnet currently used by managed instance and provided destination subnet are part of the virtual networks that are not connected with virtual network peering, or have peering established but don't have allowed traffic. In order to move managed instance from one subnet to another, virtual network peering needs to be established from both source and target virtual network. Please configure virtual network requirements and then try the operation again. Learn more https://docs.microsoft.com/en-us/azure/virtual-network/tutorial-connect-virtual-networks-portal#peer-virtual-networks.

  • 400 ManagedInstanceAndSubnetAreNotOnTheSameSubscription - Subnet provided for managed instance deployment is located on subscription different than the one submitted for managed instance. Managed instance and subnet used for deploying the instance must be on the same subscription. Please provide another subnet or switch to the subnet subscription and then try the operation again.

  • 400 CreateManagedInstanceInvalidSubnetSize - User attempted to create managed instance in a subnet that is smaller than the allowed minimal subnet size.

  • 400 AddressRangeOfTargetSubnetAndSubnetOfGeoDRReplicaCantOverlap - Subnet selected for managed instance migration has address range that overlaps with address range of subnet that holds geo replicated secondary instance. Please verify that your subnet is configured according to guidelines in https://aka.ms/move-managed-instance.

  • 400 TargetSubnetMustBeConfiguredToAllowGeoDRReplication - Subnet selected for managed instance migration is not configured to enable communication with a geo replicated secondary instance. Please check if all of the required ports are open. To properly configure your subnet read the guidelines in https://aka.ms/move-managed-instance.

  • 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

  • 400 InvalidLoginName - The provided login name is invalid.

  • 400 InvalidUsername - Supplied user name contains invalid characters.

  • 400 PasswordTooShort - The provided password is too short

  • 400 PasswordTooLong - The provided password is too long.

  • 400 PasswordNotComplex - The provided password is not complex enough.

  • 400 GatewayInvalidEdition - '{0}' is not a valid database edition in this version of SQL Server.

  • 400 StorageIOpsNotSupported - Storage IOps parameter is not allowed in the instance create/update operation.

  • 400 StorageThroughputMBpsNotSupported - Storage throughput MBps parameter is not allowed in the instance create/update operation.

  • 400 StorageIOpsNotSupportedForSpecifiedEdition - Storage IOps parameter is not allowed in the instance create/update operation for the specified edition.

  • 400 StorageThroughputMBpsNotSupportedForSpecifiedEdition - Storage throughput MBps parameter is not allowed in the instance create/update operation for the specified edition.

  • 400 InvalidLocation - An invalid location was specified.

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

  • 400 InvalidServerName - Invalid server name specified.

  • 400 AkvEndpointNotReachableFromNode - AKV endpoint '{0}' is not reachable from SQL, on server '{1}'.

  • 400 CurrentDatabaseSizeExceedsMaxSize - User attempted to reduce the max size for a database to a size smaller than the current usage.

  • 400 PasswordNotComplex - The provided password is not complex enough.

  • 400 InvalidServerName - Invalid server name specified.

  • 400 UnsupportedServiceName - The specified name is an invalid name because it contains one or more unsupported unicode characters.

  • 400 TokenTooLong - The provided token is too long.

  • 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported.

  • 400 ManagedDatabaseNameInUse - Database '{0}' already exists. Choose a different database name.

  • 400 PitrPointInTimeInvalid - The point in time {0} is not valid. Valid point in time range from {1} days early to now and not before source server creation time.

  • 400 NoMoreSpaceInManagedInstance - The managed instance has reached its storage limit. The storage usage for the managed instance cannot exceed (%d) MBs.

  • 400 CurrentDatabaseLogSizeExceedsMaxSize - User attempted to change the database to a sku with lower max log size than the current usage.

  • 400 CannotUseTrailingWhitespacesInDatabaseName - The database name validation failed.

  • 400 StorageAccountFull - Managed Instance has reached the total capacity of underlying Azure storage account. Azure Premium Storage account is limited to 35TB of allocated space.

  • 400 SameKeyMaterialNotFoundOnRemoteServer - Secondary server does not have the key material of the primary server's encryption protector.

  • 400 ServerNotFound - The requested server was not found.

  • 400 SourceServerNotFound - The server part of a source database id provided in a CreateDatabaseAsCopy API call doesn't map to an existing server.

  • 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state

  • 400 InvalidBackupRetentionPeriod - The retention days of {0} is not a valid configuration. Valid backup retention in days must be between {1} and {2}

  • 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state

  • 400 SourceDatabaseNotFound - The source database does not exist.

  • 400 DatabaseNumberLimitReached - Maximum number of databases for SQL Database Managed Instance reached.

  • 400 InvalidCollation - Collation is not recognized by the server.

  • 400 ManagedInstanceRestoreToInstanceWithOlderVersionEdition - Restore operation cannot be performed because database format of the source instance is not compatible with the database format of the destination instance. See https://go.microsoft.com/fwlink/?linkid=2251601 for more details.

  • 400 ManagedInstanceUpdateSloInProgress - "The operation could not be completed because a service tier change is in progress for managed instance '{0}.' Please wait for the operation in progress to complete and try again."

  • 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.

  • 400 AkvHostNotResolvingFromNode - AKV host '{0}' is not resolvable from SQL, on server '{1}'.

  • 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.

  • 404 ResourceNotFound - The requested resource was not found.

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 404 ResourceDoesNotExist - Resource with the name '{0}' does not exist. To continue, specify a valid resource name.

  • 404 InstancePoolNotFound - An instance pool cannot be found

  • 404 SubscriptionNotFound - The requested subscription was not found.

  • 404 CannotFindServerCertificateWithThumbprint - Cannot find server certificate with thumbprint '{0}'. Please use PowerShell Cmdlet 'Add-AzureRmSqlManagedInstanceTransparentDataEncryptionCertificate' to create the certificate.

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 ServerNotInSubscription - Specified server does not exist on the specified subscription.

  • 404 RestoreSourceDatabaseNotFound - Could not find database '{0}' at time '{1}' that can be restored.

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions

  • 404 SubscriptionNotFound - The requested subscription was not found.

  • 405 InvalidVcoreValue - vCore value {0} is not valid. Please specify a valid vCore value.

  • 405 InvalidHardwareGenerationValue - HardwareGeneration {0} is not valid. Please specify a valid HardwareGeneration value.

  • 405 InvalidStorageSizeValue - "Invalid storage size: {0} GB. Storage size must be specified between {1} and {2} gigabytes, in increments of {3} GB.

  • 405 InvalidStorageIOpsLimitValue - Invalid storage IOps limit: {0} IOps. Storage IOps limit must be specified between {1} IOps and {2} IOps, in increments of {3} IOps.

  • 405 InvalidStorageThroughputMBpsLimitValue - Invalid storage throughput limit: {0} MBps. Storage throughput limit must be specified between {1} MBps and {2} MBps, in increments of {3} MBps.

  • 409 DistributedAvailabilityGroupFailoverSecondariesNotSynchronizing - Planned failover cannot be executed if secondaries are not synchronizing.

  • 409 DistributedAvailabilityGroupFailoverLogSendQueueSizeTooBig - Planned failover cannot be executed if send queue is too large.

  • 409 DistributedAvailabilityGroupFailoverRedoQueueSizeTooBig - Planned failover cannot be executed if redo queue is too large on secondary.

  • 409 DistributedAvailabilityGroupSetRoleInstanceAlreadyInRequestedRole - User attempted to perform setRole operation while managed instance link is already in requested role.

  • 409 DistributedAvailabilityGroupSetRoleChangeRoleAlreadyInProgress - Changing the server role cannot be executed at this time as there exist a previous role change in progress on Azure SQL Managed Instance. Only when the previous role change completes, a new request could be submitted. Please wait for the previous role change to complete and retry again.

  • 409 DistributedAvailabilityGroupSetRoleFailed - Setting the role has failed due to an unknown reason. Please check the error log file. If the issue persists, contact Azure support.

  • 409 DistributedAvailabilityGroupSetRolePrimaryPlannedNotSupported - User attempted to perform setRole operation to primary in planned fashion and that is not supported.

  • 409 DistributedAvailabilityGroupDbEncryptedWithSmk - Managed database cannot be replicated from Managed Instance to SQL Server, as this managed database is encrypted with service managed key. Either decrypt the database on Managed Instance, or switch the encryption service protector to customer-managed (BYOK) and try again.

  • 409 DistributedAvailabilityGroupDbCannotBeEncryptedWhenPrimaryInMiLink - Database cannot be encrypted using the service managed key as it is being replicated from Managed Instance to SQL Server. Switch the encryption protector from service managed to customer managed (BYOK) on Managed Instance and ensure the encryption key from Managed Instance is imported on SQL Server.

  • 409 DistributedAvailabilityGroupProtectorCannotBeUpdtedToSmk - Switching the encryption protector from customer managed (BYOK) to service managed is not allowed as there exists database replication from Managed Instance to SQL Server supporting customer managed encryption only.

  • 409 DistributedAvailabilityGroupMiPrimaryWithGeodr - Database cannot be replicated from Managed Instance to SQL Server as there already exists database geo-replication from this Managed Instance to another Managed Instance using auto-failover groups. Disconnect this Managed Instance from the failover group, and try again.

  • 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 409 ConflictingServerOperation - An operation is currently in progress for the server.

  • 409 SubscriptionDisabled - Subscription is disabled.

  • 409 ServerOverridePreconditionFailed - Failed to apply server override on category '{0}', because physical db or instance '{1}' in server '{2}' is currently not in 'Ready' or 'Deactivated' state.

  • 409 ManagedInstanceIsBusy - The server '{0}' is currently busy. Please wait a few minutes before trying again.

  • 409 ServerAlreadyExists - Duplicate server name.

  • 409 ServerDisabled - Server is disabled.

  • 409 ServerQuotaExceeded - Server cannot be added to a subscription because it will exceed quota.

  • 409 SubscriptionDisabled - Subscription is disabled.

  • 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.

  • 409 RemoteDatabaseExists - The destination database name already exists on the destination server.

  • 409 ConflictingDatabaseOperation - There is already some operation on the database and the current operation should wait till it is done.

  • 409 ManagementServiceDatabaseBusy - Database '{0}' is busy with another operation. Please try your operation later.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 429 ConflictingSubscriptionOperation - An operation is currently in progress for the subscription.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 500 GatewayInternalServerError - The server encountered an unexpected exception.

  • 500 ActivateOrDeactivateWorkflowThrottling - Activation or deactivation workflow failed because there are too many concurrent workflows

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 503 DatabaseUnavailable - The operation failed because the database is unavailable.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 504 RequestTimeout - Service request exceeded the allowed timeout.

  • 504 RequestTimeout - Service request exceeded the allowed timeout.

Examples

Failover a distributed availability group.

Sample request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag/failover?api-version=2023-08-01

{
  "failoverType": "ForcedAllowDataLoss"
}

Sample response

{
  "properties": {
    "distributedAvailabilityGroupName": "dag",
    "distributedAvailabilityGroupId": "c856cff5-a6fe-418e-8894-17799cc20f5d",
    "replicationMode": "Async",
    "partnerLinkRole": "Secondary",
    "partnerAvailabilityGroupName": "BoxLocalAg1",
    "partnerEndpoint": "TCP://SERVER:7022",
    "instanceLinkRole": "Primary",
    "instanceAvailabilityGroupName": "testcl",
    "failoverMode": "None",
    "seedingMode": "Automatic",
    "databases": [
      {
        "databaseName": "testdb",
        "instanceReplicaId": "4713ed91-1e8c-497d-9bd4-d8a3935ae49a",
        "partnerReplicaId": "8ffa9723-a1ec-4323-b929-c4aedee3894b",
        "replicaState": "Catchup",
        "synchronizationHealth": "HEALTHY",
        "connectedState": "CONNECTED",
        "lastReceivedLsn": "71000009407900001",
        "lastReceivedTime": "2023-08-01T00:00:00Z",
        "lastCommitLsn": "71000009407900004",
        "lastCommitTime": "2023-08-01T00:00:00Z",
        "lastHardenedLsn": "71000009408100001",
        "lastHardenedTime": "2023-08-01T00:00:00Z",
        "lastBackupLsn": "71000009405700001",
        "lastBackupTime": "2023-08-01T00:00:00Z",
        "instanceSendReplicationLagSeconds": 1,
        "instanceRedoReplicationLagSeconds": 1
      }
    ]
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag",
  "name": "dag",
  "type": "Microsoft.Sql/managedInstances/distributedAvailabilityGroups"
}
Location: https://management.azure.com/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/providers/Microsoft.Sql/locations/westus/distributedAvailabilityGroupsOperationResults/00000000-1111-2222-3333-444444444444?api-version=2023-08-01-preview

Definitions

Name Description
CertificateInfo

Certificate information

DistributedAvailabilityGroup

Distributed availability group between box and Sql Managed Instance.

DistributedAvailabilityGroupDatabase

Database specific information

DistributedAvailabilityGroupsFailoverRequest

Distributed availability group failover.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

FailoverModeType

The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure.

FailoverType

The failover type, can be ForcedAllowDataLoss or Planned.

LinkRole

SQL server side link role

ReplicaConnectedState

Link connected state

ReplicaSynchronizationHealth

Link health state

ReplicationModeType

Replication mode of the link

SeedingModeType

Database seeding mode – can be Automatic (default), or Manual for supported scenarios.

CertificateInfo

Certificate information

Name Type Description
certificateName

string

The certificate name

expiryDate

string (date-time)

The certificate expiry date

DistributedAvailabilityGroup

Distributed availability group between box and Sql Managed Instance.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.databases

DistributedAvailabilityGroupDatabase[]

Databases in the distributed availability group

properties.distributedAvailabilityGroupId

string (uuid)

ID of the distributed availability group

properties.distributedAvailabilityGroupName

string

Name of the distributed availability group

properties.failoverMode

FailoverModeType

The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure.

properties.instanceAvailabilityGroupName

string

Managed instance side availability group name

properties.instanceLinkRole

LinkRole

Managed instance side link role

properties.partnerAvailabilityGroupName

string

SQL server side availability group name

properties.partnerEndpoint

string

SQL server side endpoint - IP or DNS resolvable name

properties.partnerLinkRole

LinkRole

SQL server side link role

properties.replicationMode

ReplicationModeType

Replication mode of the link

properties.seedingMode

SeedingModeType

Database seeding mode – can be Automatic (default), or Manual for supported scenarios.

type

string

Resource type.

DistributedAvailabilityGroupDatabase

Database specific information

Name Type Description
connectedState

ReplicaConnectedState

Link connected state

databaseName

string

The name of the database in link

instanceRedoReplicationLagSeconds

integer (int32)

Redo lag when Managed Instance link side is primary

instanceReplicaId

string (uuid)

Managed instance replica id

instanceSendReplicationLagSeconds

integer (int32)

Replication lag when Managed Instance link side is primary

lastBackupLsn

string

Last backup LSN

lastBackupTime

string (date-time)

Last backup LSN time

lastCommitLsn

string

Last commit LSN

lastCommitTime

string (date-time)

Last commit LSN time

lastHardenedLsn

string

Last hardened LSN

lastHardenedTime

string (date-time)

Last hardened LSN time

lastReceivedLsn

string

Last received LSN

lastReceivedTime

string (date-time)

Last received LSN time

lastSentLsn

string

Last sent LSN

lastSentTime

string (date-time)

Last sent LSN time

mostRecentLinkError

string

The most recent link connection error description

partnerAuthCertValidity

CertificateInfo

SQL server certificate validity

partnerReplicaId

string (uuid)

SQL server replica id

replicaState

string

Current link state

seedingProgress

string

Seeding progress

synchronizationHealth

ReplicaSynchronizationHealth

Link health state

DistributedAvailabilityGroupsFailoverRequest

Distributed availability group failover.

Name Type Description
failoverType

FailoverType

The failover type, can be ForcedAllowDataLoss or Planned.

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.

FailoverModeType

The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure.

Value Description
None
Manual

FailoverType

The failover type, can be ForcedAllowDataLoss or Planned.

Value Description
ForcedAllowDataLoss
Planned

LinkRole

SQL server side link role

Value Description
Primary
Secondary

ReplicaConnectedState

Link connected state

Value Description
DISCONNECTED
CONNECTED

ReplicaSynchronizationHealth

Link health state

Value Description
NOT_HEALTHY
PARTIALLY_HEALTHY
HEALTHY

ReplicationModeType

Replication mode of the link

Value Description
Async
Sync

SeedingModeType

Database seeding mode – can be Automatic (default), or Manual for supported scenarios.

Value Description
Automatic
Manual