How to geo-restore a private postgres flexible server having private endpoints

JPR 5 Reputation points
2024-07-23T14:45:44.4566667+00:00

Dear community,

I have a Postgres Flexible Server with the following characteristics:

  • Public access is disabled
  • A private endpoint has been deployed in a VNet (so it's not a VNet Integration as we used to do until recently)
  • simple availability
  • geo-redundant backup enabled

I would like to perform a geo restore to test our disaster recovery plan, I managed to do it with the Azure Portal, however I can not do it from Azure CLI, I anticipated that the command would be:

az postgres flexible-server geo-restore --name pgsql-dr-xxx --resource-group "rg-pool-canary" --location "germanynorth" --source-server "/subscriptions/xxx/resourceGroups/rg-pool-canary/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsql-xxx" --subscription "xxx"

However the CLI returns an error message saying: "Please specify network parameters if you are geo-restoring a private access server. Run 'az postgres flexible-server geo-restore --help' command to see examples".

I see no example of the command to execute for a server deployed with private endpoints and without public access. I also observed that if public access is enable it works well.

Could you help me figuring our the right syntax?

Azure Database for PostgreSQL
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Cloudoire Academy 23,595 Reputation points Volunteer Moderator
    2024-07-23T15:31:05.6566667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    I think you need to add private-dns-zone information too

    az postgres flexible-server geo-restore --name pgsql-dr-xxx \
        --resource-group "rg-pool-canary" \
        --location "germanynorth" \
        --source-server "/subscriptions/xxx/resourceGroups/rg-pool-canary/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsql-xxx" \
        --subscription "xxx" \
        --private-dns-zone-id "/subscriptions/xxx/resourceGroups/rg-pool-canary/providers/Microsoft.Network/privateDnsZones/yourprivatednszone"
    
    

    https://learn.microsoft.com/en-us/cli/azure/postgres/flexible-server?view=azure-cli-latest#az-postgres-flexible-server-geo-restore-examples

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **

    1 person found this answer helpful.

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.