Share via

Multiple flexible postgresql database servers stuck in delete

Alberto Zuin 0 Reputation points
2026-01-12T06:27:44.8666667+00:00

I need to delete a couple of PostgreSQL database flexible servers, but they are stuck in the deletion process.

I deleted them one at a time via the Azure portal and also via the Azure CLI. I understand that it's now a problem of a corrupted backend as similar to https://learn.microsoft.com/en-us/answers/questions/2279371/multiple-deleted-postgresql-flexible-servers-stuck

However, it seems I can't generate a priority ticket via my subscription; only public QA is available.

Thanks for helping me,

Alberto

Azure Database for PostgreSQL

1 answer

Sort by: Most helpful
  1. Saraswathi Devadula 16,025 Reputation points Microsoft External Staff Moderator
    2026-01-13T13:03:29.2666667+00:00

    Hello Alberto Zuin

    It sounds like you're having a frustrating time with your PostgreSQL flexible servers being stuck in the deletion process. This can definitely happen due to various reasons. Here are some steps and suggestions to help you troubleshoot the issue:

    1. Check for Read Replicas: Ensure that there are no read replicas associated with the servers you are trying to delete. Read replicas must be deleted before you can delete the primary server. You can check for any replicas using the Azure CLI:
    az postgres flexible-server replica list --resource-group <RESOURCE_GROUP_NAME> --server-name <SERVER_NAME>
    

    If there are replicas present, you can delete them using:

    az postgres flexible-server replica delete --resource-group <RESOURCE_GROUP_NAME> --name <REPLICA_NAME> --yes
    
    
    1. Role Assignments: Make sure that your account has the necessary permissions to delete the servers. You can check your role assignments with:
    az role assignment list --scope <SCOPE>
    
    1. Check for Resource Locks: Sometimes resource locks can prevent deletion. Make sure there are no locks applied to the servers:
    az resource lock list --resource-group <RESOURCE_GROUP_NAME>
    

    If you find any locks, you can remove them with:

    az resource lock delete --ids <LOCK_ID>
    
    
    1. Retry Deletion Command: After clearing up the dependencies (replicas, roles, and locks), try the deletion command again:
    az postgres flexible-server delete --resource-group <RESOURCE_GROUP_NAME> --name <SERVER_NAME> --yes --force
    

    If you follow these steps and the servers are still stuck in deletion, you might be facing a backend issue as you mentioned in your query. Given that you don't have access to create a priority ticket, ensure to share this information with any supporting agents you engage with for further assistance.

    Follow-Up Questions:

    • Have you checked if there are any read replicas associated with the servers?
    • Can you confirm that your account has the necessary permissions for deleting the servers?
    • Are there any resource locks applied to the servers you are trying to delete?
    • Have you tried a different account to see if the issue persists?

    Reference links: https://learn.microsoft.com/azure/postgresql/configure-maintain/how-to-enable-deletion-protection https://learn.microsoft.com/azure/role-based-access-control/overview https://learn.microsoft.com/azure/postgresql/configure-maintain/how-to-delete-server https://learn.microsoft.com/azure/postgresql/flexible-server/

    I hope these steps help you get things sorted out! If you need more specific instructions or further assistance, feel free to ask!

    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.