Azure bastion gateway cannot be deleted

Jack Williams 40 Reputation points Microsoft Employee
2026-05-29T03:29:35.7733333+00:00

Azure Bastion resource cannot be deleted. Its in a failed provisioning state. When attempting to delete, a 409 status code is returned. When attempting to change its configuration, provisioning fails again with an InternalServerError: "The resource operation completed with terminal provisioning state 'Failed'."

Azure Bastion
Azure Bastion

An Azure service that provides private and fully managed Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to virtual machines.


Answer accepted by question author
Alex Burlachenko 25,285 Reputation points MVP Volunteer Moderator
2026-05-29T07:45:32.6533333+00:00

Jack Williams hello & thanks for join me here at Q&A portal,

this is a stuck Microsoft.Network resource state. A 409 during delete plus terminal provisioning state Failed usually means the Bastion control-plane operation is wedged, not that changing the config will fix it. See if there are no locks on the Bastion resource, resource group, public IP, or VNet. Try delete Bastion resource first, then public IP, then subnet if needed. Azure Bastion troubleshooting https://learn.microsoft.com/en-us/azure/bastion/troubleshoot

If delete still returns 409, capture the failed operation from Activity Log with correlation ID and timestamp. Microsoft documents failed provisioning state for Network resources https://learn.microsoft.com/en-us/azure/networking/troubleshoot-failed-state Do not keep retrying config changes. If the resource is already in Failed and every update returns InternalServerError, this needs backend cleanup.

Open Azure Support ticket under Azure Bastion and ask for force delete/backend cleanup of failed Bastion resource. Include Bastion resource ID, public IP ID, VNet/subnet ID, region, latest 409 correlation ID, and the failed provisioning error.

rgds,

Alex

&

If my answer was helpful pls mark it and additional thx if u follow me at Q&A portal

Was this answer helpful?

1 person found this answer helpful.

Answer accepted by question author
Venkatesan S 10,830 Reputation points Microsoft External Staff Moderator
2026-05-29T04:27:41.3033333+00:00

Hi Jack Williams,

Your Azure Bastion resource is stuck in a terminal provisioning state of "Failed". This means:

The last time Azure tried to create, update, or delete it, the operation failed.

Azure now treats the resource as "in a broken state" and won't let you delete or change it normally.

Any attempt to delete returns a 409 Conflict error.

  • Any attempt to update/configure it fails with:

    "The resource operation completed with terminal provisioning state 'Failed'."

The most reliable workaround is to re-apply the current configuration using a Get + Set operation. This often resets the internal provisioning state from Failed back to Succeeded.

Powershell:

  1. Open PowerShell as Administrator.
  2. Connect to Azure and select your subscription:
       Connect-AzAccount 
       Set-AzContext -SubscriptionId "your-subscription-id"
    
  3. Get the Bastion object and reset it:
       $bastion = Get-AzBastion  -ResourceGroupName "YourResourceGroupName" -Name "YourBastionName"
       Set-AzBastion -InputObject $bastion
    
  4. Wait a couple of minutes, then check the Bastion in the portal or run:
       Get-AzBastion -ResourceGroupName "YourResourceGroupName" -Name "YourBastionName" | Select-Object Name, ProvisioningState
    
    Look for ProvisioningState to show Succeeded.

Once the provisioning state is back to Succeeded, try deleting:

Remove-AzBastion `
  -ResourceGroupName "YourResourceGroupName" `
  -Name "YourBastionName" `
  -Force

Azure CLI

az network bastion delete `
  --resource-group "YourResourceGroupName" `
  --name "YourBastionName"

Some users found that if PowerShell failed, the Azure CLI version worked (or vice versa), so try both if one doesn't work.

If the issue still persists, could you please share the required details via private message for further investigation?

Update:

As discussed, the Azure Bastion gateway was impacted by a backend-stuck operation. The backend team has successfully cleared the operation, and the Bastion gateway can now be deleted successfully.

Please let us know if you encounter any further issues.

Please do not forget to 210246-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. S Jabeen 0 Reputation points
    2026-06-08T17:14:43.7766667+00:00

    Reapply/reset the Bastion configuration using PowerShell or Azure CLI to restore the provisioning state to "Succeeded", then delete it. If it still fails, open an Azure Support ticket for backend cleanup/force deletion.

    Was this answer helpful?

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.