How To
Summary
Azure will not let you delete an ExpressRoute gateway if any dependencies (connections, public IPs, subnets, etc.) still exist.
Environment
Azure
Steps
Follow these steps:
1. Check and Remove Dependencies
Before deleting the gateway, verify there are no active ExpressRoute connections attached to it.
In Azure Portal
- Go to Virtual network gateways.
- Select your ExpressRoute gateway.
- Open Connections.
- Delete all connections listed.
Using Azure CLI
az network express-route gateway connection list </span>
--gateway-name <GatewayName> </span>
--resource-group <ResourceGroup>
You must ensure this list is empty before proceeding.
2. Delete the ExpressRoute Gateway
Azure CLI
az network vnet-gateway delete </span>
--name <GatewayName> </span>
--resource-group <ResourceGroup> </span>
--no-wait
This deletes the ExpressRoute virtual network gateway after dependencies are cleared.
PowerShell Alternative
If you are using Virtual WAN ExpressRoute Gateway, use:
Remove-AzExpressRouteGateway -ResourceGroupName <RG> -Name <GatewayName> -Force
This also deletes all ExpressRoute connections attached to it.
3. Remove Associated Resources (Optional but Recommended)
After the gateway is removed:
- Delete unused Public IPs:
az network public-ip delete --name <PublicIPName> --resource-group <ResourceGroup>
- Remove GatewaySubnet if you will no longer use it on the VNet.
4. Verify the Gateway Is Deleted
az network express-route gateway list </span>
--resource-group <ResourceGroup>
Ensure the gateway no longer appears.
If You Still Can’t Delete It
If Azure refuses deletion due to circuit state issues (common when circuits aren’t properly deprovisioned), ensure:
- The ExpressRoute circuit is deprovisioned by the service provider.
Azure will not allow deletion until this is completed. - All linked VNets are unlinked.
If deletion still fails (e.g., due to a stuck/failed connection in "Failed" state), use the Azure Resource Explorer workaround:
- Go to Resource Explorer in the portal.
- Navigate to: Subscriptions → [your subscription] → resourceGroups → [your RG] → providers → Microsoft.Network → virtualNetworkGateways → [your gateway].
- Under Connections (or directly on the gateway), find the stuck connection and use the DELETE action (switch to Read/Write mode if needed).
Delete via Azure CLI
Bash
# 1. List connections to confirm they are gone
az network express-route gateway connection list --gateway-name <GatewayName> --resource-group <ResourceGroupName>
# 2. Delete any remaining connections (if any)
az network vpn-connection delete --name <ConnectionName> --resource-group <ResourceGroupName>
# 3. Delete the gateway
az network vnet-gateway delete --name <GatewayName> --resource-group <ResourceGroupName>
Delete via PowerShell
PowerShell
# Delete the gateway (add -Force if needed)
Remove-AzVirtualNetworkGateway -Name <GatewayName> -ResourceGroupName <ResourceGroupName> -Force
Note: There is also a separate resource called ExpressRoute gateway used in Virtual WAN (Microsoft.Network/expressRouteGateways). If that's what you have (scalable gateway in a Virtual Hub), use these commands instead:
- CLI: az network express-route gateway delete --name <Name> --resource-group <RG>
- PowerShell: Remove-AzExpressRouteGateway -Name <Name> -ResourceGroupName <RG>
Additional Information
Common Issues & Troubleshooting
- "Failed to delete... there are still connections": Delete connections first (step 2 above). Stuck connections may require Resource Explorer or support.
- Gateway in migration state: Abort any ongoing gateway migration/upgrade first.
- Billing continues: The gateway stops billing once deleted, but the ExpressRoute circuit will still incur charges until you deprovision/delete it separately (contact your connectivity provider to deprovision the circuit first).
- Cannot delete GatewaySubnet afterward: Only delete the subnet after the gateway is gone (not required for gateway deletion).
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
28 April 2026
UID
ibm17271111