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
- Delete VPN connections
- Repeat for all hubs associated to the virtual WAN.
- You can either delete the hubs at this point, or delete the hubs later when you delete the resource group.
- Navigate to the resource group in the Azure portal.
- 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.