Unable to delete VPN Gateway

RP 0 Reputation points
2024-04-11T00:20:04.0066667+00:00

Unable to delete VPN site to site Gateway. Receiving the following error

Failed to delete resource

Failed to delete resource 'f000aac8ea0a49dd99bd9b21a7e78d64-eastus-gw'. Error: There is already another operation in progress for updating the gateway. Please try any update/delete operation after some time.

There are no sites attached to this gateway
User's image

User's image

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.
1,386 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. alamjeet singh 0 Reputation points
    2024-04-11T00:28:44.1533333+00:00

    Please run following command to check operations on specific resource.

    Get-AzResource -ResourceId /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/{resource-provider}/{resource-type}/{resource-name} | Select -Property ProvisioningState

    If you know that an operation should not be in progress, or if it has stalled, you might have the option to cancel it:

    Using Azure Portal:

    • Navigate to the specific resource in the Azure Portal.
    • Check for any options to cancel ongoing operations, typically available under the Overview or specific settings for that resource type.

  2. ChaitanyaNaykodi-MSFT 23,026 Reputation points Microsoft Employee
    2024-04-11T16:12:30.27+00:00

    @RP

    Thank you for reaching out.

    I understand you are facing issue while deleting your Azure VPN Gateway as it is stuck in the provisioning state.

    Usually when a resourse is stuck in provisioning state a GET-SET command can help resolve the issue. You can try running the PowerShell commands mentioned below and see if it helps in resolving the issue (A customer here found this solution and they were able delete the VPN Gateway)

    Run the command below to set the AdminState:

    $Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName RGName -Name GatewayName
    
    Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -adminstate enabled
    

    After the command above is successful you can run the Get-Set commands below and see if that helps.

    Get-AzVirtualNetworkGateway -ResourceGroupName RGName -Name GtwName | Set-AzVirtualNetworkGateway
    

    After this you can try and delete the VPN Gateway.

    Remove-AzVirtualNetworkGateway -Name GtwName -ResourceGroupName RGName
    
    
    

    Even after following the steps above, you are unable to delete the VPN Gateway, a support request will be required to delete the resource. Please follow the instructions in the private message I will make here shortly to create a support request.

    Hoper this helps!


    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments