The Azure PostgreSQL database server should use geo-redundant backups

Description

PostgreSQL uses geo-redundant backups.

Rationale

Using geo-redundancy with PostgreSQL creates geographically distributed replicas by default. These replicas assist with achieving data durability, as they protect against data becoming unavailable because of a regional event, such as a natural disaster. You can select this option only at the time of database creation. To modify an existing database to use geo-redundancy, recreate the database.

Remediation

From the console

  1. Follow the instructions listed at Tutorial: Design an Azure Database for PostgreSQL - Single Server using the Azure portal to create a new PostgreSQL database. Ensure Geo-redundant is selected under Backup redundancy options.

From the command line

  1. Follow the steps listed at Tutorial: Design an Azure Database for PostgreSQL - Single Server using Azure CLI to create and deploy a PostgreSQL server.

  2. When configuring the az postgres server create Microsoft Azure Module ensure that geoRedundantBackup is set to Enabled, as shown in the example below.

     az postgres server create 
         -l northeurope 
         -g mygroup 
         -n mysvr 
         -u username 
         -p password 
         --sku-name my_sku
         --ssl-enforcement Enabled 
         --minimal-tls-version TLS1_0 
         --public-network-access Disabled 
         --backup-retention 10 
         --geo-redundant-backup Enabled 
         --storage-size 51200 
         --tags "key=value" 
         --version 11