Failed to delete virtual network

Jean-Philip KERLOCH 20 Reputation points
2024-11-06T16:03:41.6+00:00

Hi @ChaitanyaNaykodi-MSFT and community,

I have two Vnets that do not delete. These Vnets were created with Wordpress. I've tried deleting these vnets in every way, but they won't delete them. Apparently the problem is related to a delegation subnet that has Microsoft.DBforMySQL/flexibleServer, but all related resources have already been deleted. I've even tried to recreate the WebApp, but without success. Is there anything else I can do to try to delete it?

This is a MCT subscription, and I cannot open a ticket with Microsoft.

Thank you for the support

Failed to delete subnet 'anniepillo-1ec28b29ca-dbsubnet'. Error: Subnet anniepillo-1ec28b29ca-dbsubnet is in use by anniepillo-1ec28b29ca-vnet/anniepillo-1ec28b29ca-dbsubnet/0672fd7f-79f4-6f28-6947-Ofd1a687d70e-sal and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.

I know there is just ONE solution, MSFT only can delete my subnet in backend..

Thanks for your help

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
{count} votes

Answer accepted by question author
  1. AASHISH WAGLE 75 Reputation points
    2025-10-06T11:21:51.9833333+00:00

    Hi Jean-Philip KERLOCH,

    I came under similar situation as you did, and hence, I was able to delete it by following the steps below. In the below lines, I will write my experience, and it might suit you too.

    TLDR: verify and delete the subnet delegation, it's the culprit.

    a) Inspect if subnet delegation exists:

    az network vnet subnet show \

    -g <ResourceGroup> \

    --vnet-name <VnetName> \

    -n <SubnetName> \

    --query "delegations"

    and if you see something like below, this is the cultprit that is blocking deletion.

    {

    "serviceName": "Microsoft.DBforMySQL/flexibleServers",
    
    "name": "Microsoft.DBforMySQLFlexibleServersDelegation"
    

    }

    b) Delete the delegation:

    az network vnet subnet update \

    -g <ResourceGroup> \

    --vnet-name <VnetName> \

    -n <SubnetName> \

    --remove delegations

    c) Rerun (a) to see if the delegation has been removed

    d) Retry deletion of the Virtual Network

    az network vnet delete \

    -g <ResourceGroup> \

    -n <VnetName>

    Hope this helps. if this works for you, please hit the "Accepted" Answer.


0 additional answers

Sort by: Most helpful

Your answer

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