VPN Gateway: In Failed State — Unable to Delete or Reconfigure

MJK-6582 0 Reputation points
2026-11-25T17:50:24.5233333+00:00

Problem description

I am experiencing an issue with my Azure VPN Gateway, which is currently in a Failed provisioning state. I attempted to delete the gateway and related resources, but Azure does not allow the deletion due to the failed state. Additionally, I cannot disassociate the public IP or remove dependencies on the GatewaySubnet.

Environment

Azure VPN Gateway in a virtual network, including GatewaySubnet, located in an unspecified region.

What I've already tried

I have not tried anything yet.

Current status

I am seeking guidance on how to resolve the failed state of the VPN Gateway and successfully delete the resource.

Azure VPN Gateway
Azure VPN Gateway

An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 11,055 Reputation points
    2026-11-26T07:43:51.6733333+00:00

    Hello @MJK-6582

    The public IP and GatewaySubnet dependencies can’t normally be removed while the virtual network gateway still exists. The resources must be deleted in dependency order.

    First, check the Activity log on the gateway and identify the operation that placed it in the Failed state. Save the error details, timestamp, and correlation ID. Also check for ReadOnly or CanNotDelete locks on the gateway, resource group, and subscription. Resource locks override normal RBAC permissions.

    A failed Microsoft.Network provisioning state can sometimes be cleared by submitting a PUT operation with the resource’s current configuration:

    $gateway = Get-AzVirtualNetworkGateway `
        -Name "<gateway-name>" `
        -ResourceGroupName "<resource-group>"
    $gateway | Set-AzVirtualNetworkGateway
    

    After it completes, confirm the state:

    (Get-AzVirtualNetworkGateway `
        -Name "<gateway-name>" `
        -ResourceGroupName "<resource-group>").ProvisioningState
    

    This operation resubmits the existing gateway configuration; review the current object before running it. GET/SET is a method for restoring a failed virtual network gateway to Succeeded.

    Once the gateway is no longer stuck, delete the resources in this order:

    1. Delete every connection associated with the gateway.
    2. Delete the virtual network gateway.
    3. Delete any unused local network gateway.
    4. Delete the now-detached public IP address.
    5. Delete GatewaySubnet only if it’s no longer required.

    Azure CLI example:

    az network vpn-connection delete \
      --resource-group "<resource-group>" \
      --name "<connection-name>"
    az network vnet-gateway delete \
      --resource-group "<resource-group>" \
      --name "<gateway-name>"
    

    Deleting the resource group is another option only if every resource inside it can be removed. Don’t use that approach if the resource group contains workloads that must be retained.

    If the GET/SET operation and deletion both fail with InternalServerError, Conflict, or another provider-side error, there isn’t a documented customer-side force-delete mechanism for a stuck gateway. Open an Azure support request and include the subscription ID, gateway resource ID, UTC timestamp, exact error, and correlation ID so the Microsoft.Network team can repair or remove the resource from the backend.

    References:


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.

    Was this answer helpful?

    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.