An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
Hi Lokesh,
From the output you shared, the VPN Gateway is in a Failed provisioning state and its virtualHub property is currently null. Since attaching the newly created hub is also returning InternalServerError, this looks more like a stuck/orphaned resource state than a normal dependency issue.
Before escalating to Microsoft Support, I would check the following:
Verify whether there are any VPN connections or VPN sites still associated with the gateway:
az network vpn-gateway show --resource-group <resource-group> --name <vpn-gateway-name>
Also check the Virtual WAN hub for any remaining VPN connections/sites and remove any valid dependencies before retrying the deletion.
If the gateway remains in Failed state, try retrieving and updating the resource rather than creating another hub. For Azure Virtual WAN VPN gateways, the supported PowerShell cmdlet is:
Get-AzVpnGateway -ResourceGroupName "<resource-group>" -Name "<vpn-gateway-name>"
You can then retry the delete operation:
Remove-AzVpnGateway -ResourceGroupName "<resource-group>" -Name "<vpn-gateway-name>" -Force
Microsoft documentation:
https://learn.microsoft.com/en-us/powershell/module/az.network/remove-azvpngateway
If the DELETE operation continues to return InternalServerError and there are no remaining connections/dependencies, this may require Microsoft-side backend cleanup. In that situation, I would recommend opening an Azure support request and providing the resource ID, subscription ID, resource group, region, provisioning state, and the exact InternalServerError correlation/request details.
Microsoft also documents that VPN gateway resources may need to be deleted in the correct dependency order:
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal
Since your gateway is specifically an Azure Virtual WAN VPN Gateway, the REST API also supports deleting the VPN gateway directly:
https://learn.microsoft.com/en-us/rest/api/virtualwan/vpn-gateways/delete
I would avoid repeatedly creating new hubs just to attach the orphaned gateway. If the gateway remains detached and stuck in Failed state after dependency checks and a delete attempt, Microsoft Support may need to clear the backend resource state.