Jul 31 2024 08:57 AM - edited Jul 31 2024 08:59 AM
Hi,
I'm having trouble deleting an App Service that has VNet Integration enabled. The problem arises because the VNet has been removed, and the deletion process can't find the Subnet linked to the App Service. Could you please help me delete this App Service?
Here is the error message :
An operation on the Virtual Network has failed. Details: {"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/virtualNetworks/vnet-ep45iv7w5ymp4' under resource group 'rg-rg-demo-openai' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}
Aug 11 2024 10:45 PM
Hi @slhicham
Deleting an App Service with VNet Integration can be tricky, especially if the associated VNet has already been removed. The App Service's association with the missing VNet may cause errors during the deletion process, as you've encountered. Here are steps you can follow to resolve this issue and delete the App Service:
Even though the VNet is no longer available, the App Service might still think it's integrated with it. You can try removing the VNet Integration configuration from the App Service via Azure CLI or the Azure Portal.
Using Azure CLI:
az webapp vnet-integration remove --name <AppServiceName> --resource-group <ResourceGroupName>
Replace <AppServiceName> and <ResourceGroupName> with your App Service name and the resource group name.
If the above step doesn't work, you may need to clear out the VNet integration settings directly from the site configuration using the Azure CLI.
az resource update --ids $(az webapp show --name <AppServiceName> --resource-group <ResourceGroupName> --query id --output tsv) --remove properties.siteConfig.vnetRouteAllEnabled
This command removes the VNet routing configuration from the App Service.
Once the VNet Integration configuration is removed, you can attempt to delete the App Service again.
Using Azure CLI:
az webapp delete --name <AppServiceName> --resource-group <ResourceGroupName>
After successfully deleting the App Service, ensure no leftover resources related to the App Service or VNet remain in the resource group.
If the above steps don't work, you can attempt to delete the App Service using the Azure REST API or by contacting Microsoft support to forcefully remove the resource.
Aug 12 2024 01:31 PM
Aug 12 2024 09:25 PM
Hi @slhicham,
I am afraid i am not aware of any other way to request Microsoft to delete the resources other than having the necessary support subscription.
Although can you try the below to see if they help:
Do give these a try and see if they work for you
Aug 15 2024 09:44 AM
See whether this can help:
Unable to delete VNet due to serviceAssociationLinks/AppServiceLink - Microsoft Q&A