`InUseSubnetCannotBeDeleted: Subnet snet-app is in use by /subscriptions/.../networkInterfaces/... and cannot be deleted.` during destroy.
IntermediateTroubleshootingQuota, Deployment and IaC Errors
Answer
Likely causes → Something still has a NIC or IP config in the subnet: a VM, private endpoint, AKS LB frontend, App Service integration, or a leaked NIC.
Diagnose →
az network vnet subnet show -g rg --vnet-name vnet-shop -n snet-app --query "ipConfigurations[].id" -o tsv
Fix → Delete the referencing resources first (or disconnect App Service VNet integration), then the subnet.
Prevent → Model dependencies correctly in IaC; delete the whole RG for labs.
More on Quota, Deployment and IaC Errors
`(QuotaExceeded) Operation could not be completed as it results in exceeding approved standardDSv5Family Cores quota. Location: centralindia, Current Limit: 10, Current Usage: 8, Additional Required: 4, (Minimum) New Limit Required: 12.`Beginner`SkuNotAvailable: The requested VM size Standard_D4s_v5 is currently not available in location 'centralindia' zones '3'.`Intermediate`MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.ContainerService'.`Beginner`StorageAccountAlreadyTaken: The storage account named sttfstate is already taken.`Beginner`(VaultAlreadyExists)` or `A vault with the same name already exists in deleted state. You need to either recover or purge existing key vault.`Beginner`ScopeLocked: The scope '/subscriptions/.../resourceGroups/rg-shop-prod' cannot perform delete operation because following scope(s) are locked: '/subscriptions/.../resourceGroups/rg-shop-prod'.`Beginner