An Azure managed PostgreSQL database service for app development and deployment.
Hello CHAPMAN, David
Thanks for reaching out! If your Azure Database for PostgreSQL Flexible Server is stuck (e.g., in “Stopping” or “Updating” state), here are some troubleshooting steps you can try.
- Check Server Status via CLI
az postgres flexible-server show --name <server-name> --resource-group <resource-group>
Look for the state property to confirm the current status.
- Attempt a Manual Restart
az postgres flexible-server restart --name <server-name> --resource-group <resource-group>
- Inspect for Resource Locks
az resource lock list --resource-name <server-name> --resource-group <resource-group> --resource-type "Microsoft.DBforPostgreSQL/flexibleServers"
If locks are found, remove them:
az resource lock delete --ids <lock-id>
- Scale Up Temporarily (if resource exhaustion is suspected)
az postgres flexible-server update --name <server-name> --resource-group <resource-group> --sku-name GP_Gen5_4
- Check for Blocking Queries Once the server is responsive, connect via psql and run:
SELECT pid, state, query FROM pg_stat_activity WHERE state != 'idle';SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE state != 'idle';
- Review Azure Monitor Logs Use Azure Monitor to check for errors or blockers that may be affecting server operations.
- Confirm Platform Health Visit Azure Status to ensure there are no ongoing outages in your region.
If these steps don’t resolve the issue, please send us a private message with:
• Server name
• Azure region
We’ll investigate further and help get your server unstuck
Please "Accept as Answer" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.
Thanks
Pratyush