Interview Prep/Azure/Quota, Deployment and IaC Errors

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

Azure All Azure questions

More on Quota, Deployment and IaC Errors