My Flexible PostgreSQL instance is stuck in Dropping state.

Martin Linxfeld 25 Reputation points
2025-05-30T14:44:03.52+00:00

I am working on a Terraform/OpenTofu-based deployment in Azure and attempted to destroy a PostgreSQL Flexible Server instance (foggykitchen-pg) using the azurerm_postgresql_flexible_server resource. The deletion was triggered via tofu destroy.

While the command appeared to proceed normally, the server entered a Dropping state and has remained stuck in that state for several hours now. According to the Azure Portal, the server is still visible but unresponsive to any further deletion attempts, either via CLI or manually in the Portal. All attempts to re-delete the resource return a ResourceNotFound error, even though the instance clearly still appears under "Azure Database for PostgreSQL flexible servers" with state = Dropping.

Here’s a sample CLI output for reference:


az postgres flexible-server show --name foggykitchen-pg --resource-group foggykitchen-rg1
...
"state": "Dropping",
"fullyQualifiedDomainName": "foggykitchen-pg.postgres.database.azure.com",
...

az postgres flexible-server delete --name foggykitchen-pg --resource-group foggykitchen-rg1 --yes
(ResourceNotFound) The requested resource of type 'Microsoft.DBforPostgreSQL/flexibleServers' with name 'foggykitchen-pg' was not found.

Also, the parent resource group foggykitchen-rg1 is stuck in a "Deleting..." state, likely because this resource is not fully removed.

Has anyone encountered this before? Does the deletion eventually succeed on its own (i.e., the backend completes the operation after several hours)? Or should I open a support request to have the backend forcibly remove it?

Any insight or guidance would be very much appreciated — this is currently blocking automation and testing workflows.

Thanks!

Martin (FoggyKitchen.com)

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. Saraswathi Devadula 5,570 Reputation points Microsoft External Staff Moderator
    2025-06-02T11:05:12.4166667+00:00

    Hi Martin Linxfeld

    Following up on the discussion, the Azure Database for PostgreSQL Flexible Server in the Azure portal is currently stuck in the dropping state.

    As mentioned, we attempted to drop the server from the backend.

    I hope this has been helpful!

    Your feedback is important so please take a moment to accept answers. If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    If this answers your query, do click Accept Answer and Upvote for was this answer helpful.


2 additional answers

Sort by: Most helpful
  1. Martin Linxfeld 25 Reputation points
    2025-06-02T12:42:49.7933333+00:00

    Dear Saraswathi,

    Thanks for your support. Now PG instance has disappeared from Azure Portal:

    User's image

    Please confirm once the Azure Database for PostgreSQL Flexible Server service will be ultimately fixed. I need to retest creation of the resources with OpenTofu (tofu apply) and then termination (tofu destroy) with some tests between. In fact I don't want to return back to square one if the service will not be deleted again with tofu destroy command.

    1 person found this answer helpful.

  2. Martin Linxfeld 25 Reputation points
    2025-05-30T15:41:13.3366667+00:00

    Hi Adithya,

    Thanks for your guidance.

    I’ve tried using the generic az resource delete command as well:

    bash
    
    az resource delete \
      --ids /subscriptions/9f064c73-bcb5-4f96-8422-d492d4facb39/resourceGroups/foggykitchen-rg1/providers/Microsoft.DBforPostgreSQL/flexibleServers/foggykitchen-pg \
      --verbose
    

    Unfortunately, the result is:

    pgsql
    
    (ResourceNotFound) The requested resource of type 'Microsoft.DBforPostgreSQL/flexibleServers' with name 'foggykitchen-pg' was not found.
    Code: ResourceNotFound
    Message: The requested resource of type 'Microsoft.DBforPostgreSQL/flexibleServers' with name 'foggykitchen-pg' was not found.
    

    Still, the instance shows up in Azure CLI using:

    bash
    
    az postgres flexible-server show --name foggykitchen-pg --resource-group foggykitchen-rg1
    

    And its state is Dropping. This has been the case for many hours now. I'm blocked from re-deploying or creating a new instance with the same name.

    Could you please escalate this to the backend team? This seems like a control plane/data plane inconsistency.

    Thank you,

    Martin Linxfeld


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.