Hi Mostafiz
Greetings!
As we understand that, you are facing an issue with Azure Database for PostgreSQL – Flexible Server where the server becomes stuck in the "Stopping" state and is unresponsive to CLI or portal commands.
Here are a few steps you might consider:
- Sometimes servers can take longer to stop due to ongoing processes. You might want to wait a little longer and check if the status changes.
- Go to the Azure portal and check the service health dashboard. There might be some ongoing issues affecting the PostgreSQL service in your region.
- If the server remains stuck, you could consider forcing a stop or restart. You can try using the Azure CLI with the --failover option to perform a forced operation: az postgres flexible-server restart --name <your-server-name> --resource-group <your-resource-group> --failover Forced
- Use the Azure Monitor logs to check for errors or blockers. Run the following to query logs:
az monitor log-analytics query \
--workspace <workspace-id> \
--analytics-query "AzureDiagnostics | where ResourceId == '<server-resource-id>'"
- Confirm if the server has management locks that might be preventing the stop action using bash command: az resource lock list --resource-name <server-name> --resource-group <resource-group> --resource-type "Microsoft.DBforPostgreSQL/flexibleServers"
- Remove locks if present: az resource lock delete --ids <lock-id>
- If resource exhaustion is suspected, scale the server up temporarily using bash command: az postgres flexible-server update --name <server-name> --resource-group <resource-group> --sku-name GP_Gen5_4
If the above steps do not resolve the issue, could you please share the requested details via private message as it will help us conduct a more thorough investigation.
I hope this information helps. Please do let us know if you have any further queries.