Hi Mahesh
Thanks for using the Q&A platform.
It seems you're dealing with a stuck deletion state for your Azure PostgreSQL Flexible Server. It's showing as "Dropping" in the portal, yet neither Terraform destroy nor Az Postgres Flexible Server delete can fully remove it. This usually happens when a resource enters a “zombie” state due to incomplete deletion.
Can you verify the deletion status using Azure Resource Graph using the below command:
az graph query -q "Resources | where name == 'krisatwork-dev-postgres-db' and type =~ 'microsoft.dbforpostgresql/flexibleservers'"
If the result is empty, the resource is already logically gone, but metadata may be stuck.
You can also use the following document to adjust your query: https://learn.microsoft.com/en-us/azure/governance/resource-graph/concepts/query-language
Also, you can try force deletion using the Azure REST API:
az rest --method delete \
--url https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/kaw-dev-datastore/providers/Microsoft.DBforPostgreSQL/flexibleServers/krisatwork-dev-postgres-db?api-version=2023-06-01-preview
Find Microsoft documentation: https://learn.microsoft.com/en-us/cli/azure/use-azure-cli-rest-command?view=azure-cli-latest&tabs=bash#use-delete-to-delete-your-azure-container-registry
If the issue persists, you can also seek help from Microsoft Azure support to help with running a backend cleanup to fully remove it.
You can mark it 'Accept Answer' and 'Upvote' if this helped you
Regards,
Obinna