Review geo-redundant backups for Azure PostgreSQL

Provide a database recovery option for a regional outage.

Description

Geo-redundant backups replicate PostgreSQL backups to a paired region. Backups held only within the primary region may not provide sufficient recovery options during a regional outage.

Potential impact

Without a recovery option in another region, restoring the database during a prolonged regional outage may be difficult.

Remediation

Check recovery requirements and regional support, then select geo_redundant_backup_enabled = true when creating the server. Changing this on an existing server requires replacement, so plan recovery or migration first.

Examples

These excerpts show backup settings for current PostgreSQL Flexible Server. Set the region input to a location that supports geo-redundant backups.

Before

hcl
resource "azurerm_postgresql_flexible_server" "example" {
  name                = "dbserver"
  location            = var.region
  resource_group_name = azurerm_resource_group.example.name

  backup_retention_days        = 7
  geo_redundant_backup_enabled = false
}

After

hcl
resource "azurerm_postgresql_flexible_server" "example" {
  name                = "dbserver"
  location            = var.region
  resource_group_name = azurerm_resource_group.example.name

  backup_retention_days        = 7
  geo_redundant_backup_enabled = true
}

References