Share via

Azure PostgreSQL Flexible Server stuck in Dropping state; delete returns ResourceNotFound but resource remains

DJJ 0 Reputation points
2026-05-01T19:30:42.6966667+00:00

We created an Azure Database for PostgreSQL Flexible Server using Bicep-based infrastructure-as-code scripts.

We later attempted to remove the PostgreSQL estate using our cleanup script:

pwsh .\IAC\Infra\Databases\PostgreSQL\remove-postgresql-estate.ps1 `

-SubscriptionId "<subscription-id>" `

-ResourceGroupName "<resource-group>" `

-PostgreSQLServerName "<server-name>" `

-KeyVaultName "<key-vault-name>" `

-DeletePrivateDnsZone `

-Confirm:$false

During the cleanup/delete operation, the PowerShell session/window was terminated before the operation completed.

Since then, the PostgreSQL Flexible Server has been stuck in a partial deletion state. It still appears in Azure Portal, Azure Resource Graph, and az postgres flexible-server list with state Dropping.

However, all delete attempts now return ResourceNotFound.

We have tried the following recovery/delete approaches:

  1. Standard PostgreSQL Flexible Server delete:

az postgres flexible-server delete `

--resource-group "<resource-group>" `

--name "<server-name>" `

--yes

Result:

ResourceNotFound

  1. Direct ARM REST delete:

az rest --method delete `

--url "https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.DBforPostgreSQL/flexibleServers/<server-name>?api-version=2023-06-01-preview"

Result:

ResourceNotFound

  1. Generic ARM resource delete:

az resource delete `

--ids "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.DBforPostgreSQL/flexibleServers/<server-name>"

Result:

ResourceNotFound

  1. Redeployment reconciliation attempt:

We attempted to redeploy the same server name using the same Bicep/IAC deployment path, hoping Azure would reconcile the stuck Dropping state.

Result:

Deployment failed with ServerNameAlreadyExists.

The resource name still appears to be reserved, but delete operations cannot find the resource.

The stuck PostgreSQL Flexible Server also appears to be blocking cleanup of the delegated VNet subnet. The subnet still has a PostgreSQL service association link with linkedResourceType Microsoft.DBforPostgreSQL/flexibleServers, and VNet deletion fails because the subnet is still marked as in use.

Request:

Please advise how we can request or perform a backend cleanup of the stuck PostgreSQL Flexible Server metadata/name reservation and release the associated subnet service association link.

We do not need the PostgreSQL server recovered. We need the stuck resource fully removed so the remaining network resources can also be deleted cleanly and no further costs are charged to the subscription.

Azure Database for PostgreSQL

2 answers

Sort by: Most helpful
  1. Manoj Kumar Boyini 14,495 Reputation points Microsoft External Staff Moderator
    2026-05-19T02:41:37.7666667+00:00

    Hi @DJJ

    Our engineering (PG) team has completed a backend validation and confirmed that the PostgreSQL Flexible Server was in a “tombstoned” state. This typically occurs when a delete operation is interrupted mid-way, leaving residual metadata (such as name reservation and subnet associations) even though the resource itself is no longer fully active.

    The PG team has now completed the backend cleanup and fully removed the server metadata, including the associated tombstoned state.

    Please let us know if you have any questions or concerns.

    Was this answer helpful?

    0 comments No comments

  2. DJJ 0 Reputation points
    2026-05-01T20:50:06.1133333+00:00

    thanks, Manoj, answers along with fuller details anout the issue have been provided in the private message

    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.