I have an Azure VNet and it was used for Azure Environment Service. Since it is no longer used, I deleted all relative resources. But when I delete this VNet, there is an error :
Failed to delete virtual network 'name-vnet'. Error: Subnet legoexttest-subnet is in use by /subscriptions/XXX/providers/Microsoft.Web/hostingEnvironments/name and cannot be deleted.
I've found this Troubleshooting: Failed to delete a virtual network document. I checked the issues one by one and still didn't solve my problem.
I'm sure that there is no connected device or service endpoint in my VNet. But there is an Address Space and a Subnet in it. I also can't delete either of them because the same error :
Failed to delete subnet 'name-subnet'. Error: Subnet legoexttest-subnet is in use by /subscriptions/XXX/providers/Microsoft.Web/hostingEnvironments/name and cannot be deleted.
I just don't know what is /providers/Microsoft.Web and how to delete or enable this use in order to delete my VNet in Azure.
/providers/Microsoft.Web
means Microsoft provide the Web service. For your issue, which location you select and you can try to delete the vnet with PowerShell command or Azure CLI. – Charles Xu