Unable to delete resource group containing app service due to vnet resource already deleted.

ikenna_sa 0 Reputation points
2024-06-02T22:26:27.78+00:00

I have been trying to delete a resource group that has an app service. It has been unable to delete for days now due to the below issue. The vnet - passvnet has been deleted from the resource group and I have been stuck here for days.

"The Resource 'Microsoft.Network/virtualNetworks/passvnet' under resource group 'demo-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,273 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vlad Costa 780 Reputation points
    2024-06-02T23:10:33.7833333+00:00

    Sure, here’s a response you can use:


    Hello @ikenna_sa ,

    This can happen if the resource was deleted but Azure still has a reference to it.

    One possible solution is to use Azure PowerShell or Azure CLI to force delete the resource group. Here’s how you can do it:

    Azure PowerShell:

    Remove-AzResourceGroup -Name "demo-rg" -Force -AsJob
    

    Azure CLI:

    az group delete --name "demo-rg" --yes --no-wait
    

    These commands will delete the resource group and all its resources without waiting for the operation to complete.

    Please remember to replace "demo-rg" with the name of your resource group.

    If this answer solves your problem, please mark it as accepted.


  2. brtrach-MSFT 15,786 Reputation points Microsoft Employee
    2024-06-04T02:46:08.5033333+00:00

    @ikenna_sa Sure, here are the steps to delete your resource group using resources.azure.com (this helps to remove any UI bugs from the equation):

    1. Open a web browser and navigate to https://resources.azure.com/.
    2. Sign in with your Azure account credentials.
    3. In the left-hand navigation pane, click on "Subscriptions" and select the subscription that contains the resource group you want to delete.
    4. Expand the subscription and select "resourceGroups".
    5. Find the resource group you want to delete and click on it to expand it.
    6. Click on the "DELETE" button at the top of the page.
    7. In the confirmation dialog box, type the name of the resource group you want to delete and click on the "DELETE" button.

    If you encounter an error message stating that the resource group cannot be deleted due to a missing resource, such as the vnet resource in your case, you can try the following steps:

    1. Navigate to the "Microsoft.Network/virtualNetworks" resource type in the left-hand navigation pane.
    2. Find the virtual network that is causing the issue and click on it to expand it.
    3. Click on the "DELETE" button at the top of the page.
    4. In the confirmation dialog box, type the name of the virtual network you want to delete and click on the "DELETE" button.
    5. Once the virtual network is deleted, try deleting the resource group again.

    If you still encounter issues deleting the resource group, you can try deleting the app service first and then deleting the resource group. To delete the app service, navigate to the "Microsoft.Web/sites" resource type in the left-hand navigation pane, find the app service you want to delete, and click on it to expand it. Then, click on the "DELETE" button at the top of the page and follow the confirmation steps.

    If the above steps do not work, please reply to this answer as we have next steps to provide you via a private message. Let's hope the above works though. We look forward to your reply.