Managed Instances - Delete

Deletes a managed instance.

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

URI Parameters

Name In Required Type Description
managedInstanceName
path True

string

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.

Responses

Name Type Description
200 OK

Successfully deleted the managed instance.

202 Accepted

Successfully initiated deletion of the managed instance.

Headers

Location: string

204 No Content

The specified managed instance does not exist.

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 SubnetMissingRequiredDelegation - Selected subnet is not delegated for SQL Managed Instance.

  • 400 ManagementServiceManagedServerDisabled - Operation failed since Managed Instance '{0}' is disabled. Please enable Managed Instance and try again.

  • 400 MiGeoRestoreWithWrongBackupStorageRedundancy - Geo-Restore is not allowed for managed instances with LRS/ZRS backup storage redundancy.

  • 400 LastBackupNameHasNewline - Please do not use forbidden characters ('\n', '\r') in lastBackupName.

  • 400 LastBackupNameHasNonAsciiCharacter - The operation was aborted because the 'LastBackupName' parameter contains invalid characters. Only ASCII characters are allowed.

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

  • 400 LRSCutoverDatabaseDoesNotExist - The operation was aborted because the database name specified in the request doesn't match any database name on the specified server.

  • 400 LRSCutoverDatabaseNotInRestoringState - The operation was aborted because the specified database is not in restoring state.

  • 400 LRSCutoverDatabaseAlreadyRestored - The operation was aborted because the specified database was already restored.

  • 400 LRSCutoverAlreadyInitiated - The operation was aborted because a cutover for the specified database is already in progress.

  • 400 ManagementServiceFeatureDisabled - User attempted to use a feature which is disabled.

  • 400 AadOnlyAuthenticationIsEnabled - Azure Active Directory Only Authentication is enabled. Please contact your system administrator.

  • 400 UpdatingInstanceAndBackupRedundancy - Instance zone redundancy and backup storage redundancy cannot be updated in the same request.

  • 400 DeleteOfManagedInstanceIsDisabled - Delete operation of managed instance is disabled.

  • 400 RequestCantLandOnPaaSv2Platform - Request needs to land on PaaSv2 platform but PaaSv2 is not enabled.

  • 400 CustomMaintenanceWindowIsDisabled - Custom maintenance window is not enabled.

  • 400 DeleteOfVersion2VirtualClusterIsDisabled - Delete of virtual cluster with version 2 is not enabled.

  • 400 DeleteOfVirtualClusterIsDisabled - Delete of virtual cluster is not enabled.

  • 400 MICantBeMovedFromOrToInstancePool - Existing managed instance can't be moved to managed instance pool.

  • 400 DnsRefreshOnVirtualClusterIsDisabled - Refresh of DNS records on virtual cluster is not enabled.

  • 404 ManagedInstanceNotInSubscriptionResourceGroup - Specified managed instance does not exist in the specified resource group and subscription.

  • 404 SubscriptionNotFound - The requested subscription was not found.

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

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

  • 404 ResourceNotFound - The requested resource was not found.

  • 409 MiCreateFailedNonDelegatedSubnet - User tried to deploy Managed Instance or Managed Instance pool in subnet that is not delegated to Microsoft.Sql/managedInstances.

  • 409 InstancePoolBusy - An instance pool is busy with another ongoing operation

  • 409 ConflictingManagedInstanceOperation - An operation is currently in progress for the managed instance.

  • 409 BackupRedundancyUpdateAndInstanceRedundancyConflict - The instance is multi-az but backup storage is being updated from zone redundant to non-zone redundant.

  • 409 InstanceRedundancyUpdateWhileBackupRedundancyUpdateInProgress - Cannot update instance redundancy because backup storage redundancy update is in progress.

  • 409 InstanceRedundancyUpdateAndBackupRedundancyConflict - The backup storage is non-zone redundant but instance redundancy is being updated to zone redundant.

  • 409 BackupRedundancyUpdateConflict - Cannot update backup storage redundancy because a backup storage redundancy update is already in progress.

  • 409 MiDropFailedOnAuthLocks - User tried to drop last Managed Instance in subnet that has Lock applied on resource(s).

  • 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.

  • 412 InstanceNotReadyForBackupRedundancyUpdate - Cannot update backup storage redundancy because the instance is not ready.

  • 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 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.

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

  • 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 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

Delete managed instance

Sample request

DELETE https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance?api-version=2023-08-01

Sample response

Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/eastus/managedInstanceOperationResults/11111111-1111-1111-1111-111111111111
Azure-AsyncOperation: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/eastus/managedInstanceAzureAsyncOperation/11111111-1111-1111-1111-111111111111

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

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.