How to force delete the vHub with "disconnected" virtual connections (those connections to the vnet had been deleted)

Barany Mok 0 Reputation points
2025-09-10T09:19:09.9666667+00:00

Team, I created a vWAN and a vHub, as well as virtual connections to 2 vNet in different region for testing the connectivity with the regional sdwan, it worked as expected. After then, I deleted all resource under the same resource group, however, everything had been properly deleted, only the virtual connections under vHub were not (could not) deleted and not allowed further removing the vHub / vWan in a sense.

What I should do to clean up this. It seems to be a inter-dependence issue within Azure vWAN/vHUB or something I have missed..thankserror message when deleting the virtual connection

'vHub-UKS/UKS-velo-vhub' can't be deleted because either you do not have permission or the resource has parent lock/s. Locks must be removed before this resource can be deleted.

Under the lock page..

This resource has no locks.

When deleting the vHUB, I received below error

User's image

Azure Virtual WAN
Azure Virtual WAN
An Azure virtual networking service that provides optimized and automated branch-to-branch connectivity.
{count} votes

1 answer

Sort by: Most helpful
  1. Ganesh Patapati 10,065 Reputation points Microsoft External Staff Moderator
    2025-09-10T11:38:47.48+00:00

    Hello Barany Mok

    As documented here, can you please try following the steps and see if that helps in deleting the resources.

    Some of the Virtual WAN resources must be deleted in a certain order due to dependencies. Deleting can take about 30 minutes to complete.

    • Open the virtual WAN that you created.
    • Select a virtual hub associated to the virtual WAN to open the hub page.
    • Delete all gateway entities following the below order for each gateway type. This can take 30 minutes to complete.

    VPN:

    • Disconnect VPN sites
      • Delete VPN connections
        • Delete VPN gateways
    1. Repeat for all hubs associated to the virtual WAN.
    2. You can either delete the hubs at this point, or delete the hubs later when you delete the resource group.
    3. Navigate to the resource group in the Azure portal.
    4. Select Delete resource group. This deletes the other resources in the resource group, including the hubs and the virtual WAN.

    Even if you can't see them in the Portal, they may still exist in Azure's backend.

    az network vhub connection list \
      --resource-group <your-resource-group> \
      --hub-name <your-vhub-name>
    

    If any connections are returned, delete them:

    az network vhub connection delete --resource-group <resource-group> --vhub-name <vhub-name> --name <connection-name>
    
    

    If the above step doesn’t work, you might want to try using PowerShell to forcefully remove the virtual hub connection: (if necessary)


    Remove-AzVirtualHubVnetConnection -VirtualHubName <VHubName> -Name <ConnectionName> -ResourceGroupName <ResourceGroupName> -Force
    
    

    Refer: https://learn.microsoft.com/en-us/cli/azure/network/vwan?view=azure-cli-latest


    I hope this was helpful!

    If the above is unclear or you are unsure about something, please add a comment below.

    0 comments No comments

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.