An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
This error usually indicates one of these conditions:
- A gateway of the same type still exists or is stuck in the virtual network state.
- The virtual network is configured for coexistence constraints that are not currently met.
- The gateway subnet sizing does not support the gateway combination being created.
For this scenario, check these items in order:
- Verify the gateway subnet exists and is valid. In the portal, the Gateway subnet address range field is empty in the screenshot, and Azure requires a GatewaySubnet to create a VPN gateway. If the virtual network does not already contain a subnet named GatewaySubnet, create it first, then return to the VPN gateway creation page.
- If this virtual network previously had another gateway and coexistence is involved, check the GatewaySubnet size. For coexisting ExpressRoute and Site-to-Site VPN gateways, if the gateway subnet is /28 or /29, the existing gateway must be deleted and the gateway subnet must be recreated as /27 or larger before creating the new gateway.
- If the virtual network previously had only one gateway and another gateway type is being added, coexistence is supported only when the gateway subnet is /27 or larger. If it is smaller, delete the old gateway, recreate GatewaySubnet with /27 or shorter prefix such as /26 or /25, and then create the gateways again.
- If the previous VPN gateway was PolicyBased, it cannot be reused for this scenario. Site-to-site add/remove guidance requires the virtual network gateway to be RouteBased. If the old gateway was PolicyBased, it must be deleted and recreated as RouteBased.
- If the deleted gateway is still effectively blocking the VNet, confirm there is no gateway resource left in a failed state. A failed virtual network gateway can block related VNet operations until it returns to Succeeded state.
- When recreating the VPN gateway, ensure the required settings are valid:
- Gateway type = VPN
- Generation = Generation2
- A valid GatewaySubnet is present
- Public IP settings are configured during creation
Important: deleting and recreating gateways or the GatewaySubnet causes downtime for cross-premises connectivity.
If the VNet had an ExpressRoute or another gateway previously, the most likely fix is to recreate GatewaySubnet with /27 or larger and then create the VPN gateway again.
- Configure ExpressRoute and Site-to-Site coexisting connections using the Azure portal
- Configure ExpressRoute and Site-to-Site coexisting connections using the Azure portal
- Add or remove VPN Gateway site-to-site connections
- Tutorial: Create a site-to-site VPN connection in the Azure portal
- Unable to add new subnet in existing virtual network - Microsoft Q&A