An Azure relational database service.
Cancel the ongoing scaling operation if Azure marks it cancellable, then delete the SQL Managed Instance and allow Azure to remove its virtual cluster before deleting the virtual network and resource group.
Warning: Deleting the managed instance or resource group is irreversible and can permanently remove databases and unrelated resources. Before proceeding, review the complete resource-group inventory and verify that required data is covered by recoverable backups or exports and applicable retention requirements.
1. Cancel the scaling operation
Most compute-scaling and service-tier changes are cancellable, but General Purpose storage scaling is not. Instance deletion itself is also not cancellable.^1^
In the Azure portal:
- Open the SQL managed instance → Overview.
- Select the notification labeled Ongoing operation or Scaling managed instance.
- Select Cancel the operation, and confirm.
- Wait until the operation reports that cancellation succeeded.
Alternatively, use Azure Cloud Shell:
az sql mi op list \
--resource-group "<resource-group>" \
--mi "<managed-instance>" \
--output table
az sql mi op list -g "<resource-group>" --mi "<managed-instance>" \
--query "[?state=='InProgress' && isCancellable].name" -o tsv |
while read -r operationName; do
az sql mi op cancel -g "<resource-group>" \
--mi "<managed-instance>" -n "$operationName"
done
The operations list shows the actual backend state rather than only the resource status displayed on the Overview page.^2^
If Cancel is disabled or isCancellable is false, do not repeatedly submit delete requests. The documentation says a non-cancellable phase should normally finish shortly; because this one has already exceeded 24 hours, proceed to the diagnostics and escalation section below if deletion remains blocked.
2. Check for inherited deletion locks
A lock on the resource, resource group, or subscription can block deletion. Subscription locks are inherited, so check both scopes.^3^
# Resource-group and resource-level locks
az lock list --resource-group "<resource-group>" \
--query "[].{Name:name,Level:level,Scope:id}" --output table
# Subscription-level locks
az lock list \
--query "[].{Name:name,Level:level,Scope:id}" --output table
Remove only an approved blocking lock:
az lock delete --ids "<lock-resource-id>"
3. Delete the managed instance first
From SQL managed instance → Overview, select Delete. Delete only the intended instance at this stage, rather than the entire resource group.
Deletion cleans up the SQL process and VM group. If this is the last instance in the subnet, VM-group removal initiates virtual-cluster removal.^4^
Do not manually delete the virtual cluster. It is platform-managed and is automatically removed after the last instance is deleted; that cleanup can take up to 1.5 hours.^5^
4. Clear remaining subnet dependencies
After both the managed instance and virtual cluster are gone, inspect the subnet:
az network vnet subnet show \
--resource-group "<resource-group>" \
--vnet-name "<vnet-name>" \
--name "<subnet-name>" \
--query "{delegations:delegations[].serviceName,
links:serviceAssociationLinks[].linkedResourceType}" \
--output json
If Microsoft.Sql/managedInstances remains only under delegations, remove it:
az network vnet subnet update \
--resource-group "<resource-group>" \
--vnet-name "<vnet-name>" \
--name "<subnet-name>" \
--remove delegations
A delegation and a service association link are different:
- A remaining delegation can be removed after all SQL managed instances are gone.
- If a SQL service association link remains, wait 10–15 minutes for platform cleanup and retry. If it persists, it requires Azure support; it should not be force-deleted.^6^
Once those dependencies are clear, delete the virtual network and then the resource group.
If the managed instance remains stuck
Run the built-in resource diagnostic:
- Open the managed instance.
- Select Support + troubleshooting.
- Choose the category for creating or dropping a managed instance and run the offered diagnostics.
If diagnostics cannot clear the operation, backend intervention is required. A Visual Studio Enterprise (Standard) subscription can include four technical-support incidents for non-production break/fix issues; monthly cloud subscriptions and some program-provided subscriptions are not eligible. Activate the benefit to obtain its Contract ID and Access ID, then link those under Azure portal → Help + Support → Support Plans → Link support benefits and submit the SQL Managed Instance request.[^7^](https://learn.microsoft.com/visualstudio/subscriptions/[Subscription ID] "Use your Technical Support benefit in Visual Studio subscriptions")
Include the managed-instance name, region, operation start time, operation name/state from az sql mi op list, and the statement that scaling has remained active for more than 24 hours and blocks deletion.
References
- Cancel Azure SQL Managed Instance management operations
- Monitoring Azure SQL Managed Instance management operations
- Lock your Azure resources to protect your infrastructure
- Duration of management operations in Azure SQL Managed Instance
- Virtual cluster architecture - Azure SQL Managed Instance
- Troubleshoot subnet deletion and modification failures in Azure Virtual Network
- [Use your Technical Support benefit in Visual Studio subscriptions](https://learn.microsoft.com/visualstudio/subscriptions/[Subscription ID])