Hi Micheal Mueller,
Thank you for reaching out to Microsoft QA!
it sounds like you're running into some trouble with restoring a PostgreSQL flexible server backup in your staging environment. Here are a few steps you can take to troubleshoot this issue:
First, check the deployment status in your staging RG using Azure CLI:
text
az deployment group list --resource-group <staging-rg-name> --query "[?properties.provisioningState=='Failed']"
This lists failed deployments. For the relevant one, inspect details:
text
az deployment group show --name <deployment-name> -g <staging-rg-name> --query "properties"
If it confirms a failed PostgreSQL server creation, force cleanup with:
text
az postgres flexible-server delete --resource-group <staging-rg-name> --name <server-name> --yes
If the resource remains "not found," list all potential matches:
text
az resource list --resource-group <staging-rg-name> --resource-type "Microsoft.DBforPostgreSQL/flexibleServers" --output table
Delete any orphans directly. Wait 5-10 minutes post-cleanup before retrying the restore, as Azure needs time to propagate changes.
Restore Retry Best Practices:
Verify your source backup is within the retention period (7-35 days default) and the server state is "Ready" via portal or CLI (az postgres flexible-server show). Match compute/storage configs exactly between dev/staging, and avoid cross-AZ/region restores if not supported. Use "Fast Restore" from a recent full snapshot for quicker success, or CLI for precision:
text
az postgres flexible-server create --resource-group <staging-rg> --name <new-server> --location <region> --source-server <source-server> --restore-time "<timestamp>"
Monitor via Activity Log (filter by "Microsoft.DBforPostgreSQL/flexibleServers" operations).
For further assistance, I suggest trying these things first, and if the problems persist, could you provide more details on the following?
What exact steps did you follow for the restoration?
Are there any error messages or codes that you can share?
What type of network configuration is your server using (public or private)?
Have you checked if the backup was correctly made and is indeed available for restoration?
Reference:
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-restore-full-backup?tabs=portal-restore-full-backup
if it doesn't work try doing in different region(ex: USwest3).
Hope this helps!Feel free to reach out if you have any more questions!
Following up to see if the below answer was helpful. If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.