cannot delete webapp and app service plan

Temidayo Ojo 100 Reputation points
2024-12-12T22:42:16.14+00:00

I attempted to delete the RG where I have deployed my vnet, app service plan and web app.

the delete operation completed but the app service plan and web app were still present afterwards.

subsequent deletion of the web app / app service gave the bellow error:

*An operation on the Virtual Network has failed. Details: {"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/virtualNetworks/Ase-Vnet' under resource group 'ASE-RG' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}

I have tried using powershell but to no avail. I need to delete these resources as they are consuming my money.*

please any help would be appreciated

FYI i use an msdn subscription.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,096 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,021 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. akinbade abiola 21,130 Reputation points
    2024-12-13T06:15:26.23+00:00

    Hello Temidayo,

    Thanks for yout question.

    This happens when a Vnet is deleted before disconnecting the integration, leaving orphaned links blocking deletion.

    You can use the workaround Steps here:

    • Recreate an App Service Plan with the same name as the deleted one.

    Create an App Service with the same name as the deleted one.

    • Recreate the VNet Integration from Web App > Networking Blade > New VNet Integration and select the specific subnet.
    • Properly remove the VNet Integration by hitting “Disconnect” in the Web App > Networking > VNet Integration.
    • Delete the subnet.

    See: https://zcusa.951200.xyz/en-us/azure/azure-resource-manager/troubleshooting/error-not-found?tabs=bicep

    If the above steps do not work, you may need to create a support request for assistance.

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola


  2. Shree Hima Bindu Maganti 1,600 Reputation points Microsoft Vendor
    2024-12-20T16:46:59.0666667+00:00

    Hi Temidayo Ojo ,
    I am sorry for late response and thankyou for your detailed explanation.
    You're absolutely correct! When a Virtual Network (VNet) is deleted without properly disconnecting resources like the Web App or App Service Plan, remnants of the VNet integration remain, causing issues like the one you're facing.
    Identify Dependencies and Check the App Service Plan and Web App settings to confirm references to the deleted Virtual Network .Use Azure CLI.
    az resource show --ids <resource-id>

    Validate the lingering integration via the Networking blade in the Azure portal.

    Recreate the VNet with the same name (Ase-Vnet) and subnet configuration in the same resource group (ASE-RG).

    Go to Web App > Networking > VNet Integration.

    Reintegrate the Web App with the recreated VNet and its subnet.

    Once integrated, properly disconnect the VNet Integration.

    After disconnecting, delete the Web App and App Service Plan from the Azure portal or CLI.
    Force Delete Using CLI and if deletion fails then
    az resource delete --ids <resource-id>
    ref:Azure Resource Deletion Issues

    Manage VNet Integration for Web Apps

    Delete Azure Resources Using CLI

    Remove Orphaned VNet Integrations
    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.