Backing up databases in cloud environments is a foundational requirement for disaster recovery, compliance, and business continuity. Azure Database for PostgreSQL (Flexible Server) provides two primary backup mechanisms through the Azure Portal: Operational Backups (native automated snapshots and WAL logs for point-in-time restoration up to 35 days) and Vaulted Backups / Long-Term Retention (LTR) (managed via Azure Backup for extended compliance up to 10 years).
This guide walks through configuring, managing, and executing both backup strategies directly from the Azure Portal.
1. Understanding Azure PostgreSQL Backup Architecture
Before configuring backups, it is essential to distinguish between the two available tiers:
| Feature | Operational Backups (Native) | Vaulted Backups (Azure Backup LTR) |
|---|---|---|
| Primary Scope | Full server snapshot + Write-Ahead Logs (WAL) | Long-term compliance & isolated offsite copy |
| Retention Window | 7 to 35 days | Up to 10 years |
| Storage Isolation | Stored in regional storage accounts | Isolated in a dedicated Backup Vault (separate security domain) |
| Redundancy Options | LRS, ZRS, or Geo-Redundant (GRS) | Configurable vault redundancy (LRS / GRS) |
| Use Cases | Day-to-day recovery, accidental edits, pre-deployment snapshots | Regulatory compliance, ransomware air-gapping, audit retention |
2. Managing Operational Backups (0–35 Days)
Azure Database for PostgreSQL Flexible Server automatically executes daily storage volume snapshots and continuous transaction log backups out of the box.
Configuring Retention Period & Storage Redundancy
Log in to the Azure Portal.
In the top search bar, search for Azure Database for PostgreSQL flexible servers and select your server instance.
Under the left-hand navigation menu, select Settings > Compute + storage.
In the Backup section:
Backup Retention Period: Drag or enter your preferred retention window (between 7 and 35 days).
Backup Redundancy: Review your storage redundancy setting (Locally Redundant or Zone Redundant).
Note: Geo-redundancy (GRS) can only be selected during initial server creation and cannot be modified post-provisioning.
Click Save at the top of the pane.
Triggering an On-Demand Snapshot
If you are preparing to deploy code, execute database migrations, or make major schema modifications, create an immediate manual backup:
In your PostgreSQL flexible server pane, navigate to Settings > Backup and Restore (or Overview depending on your Portal layout).
Click Backup now.
Enter a descriptive Backup Name (e.g.,
pre-migration-v2-1-0) and confirm.
3. Configuring Long-Term Retention (LTR) via Azure Backup
For compliance frameworks requiring data preservation beyond 35 days, integrate your PostgreSQL instance with an Azure Backup Vault.
Step 1: Create a Backup Vault
In the Azure Portal search bar, type Backup vaults and select it.
Click + Create.
Under Project Details, choose your Subscription and Resource Group.
Set the Vault Name (e.g.,
bv-postgresql-prod-eastus) and select the Region (must match the region of your PostgreSQL server).Select your desired Vault Redundancy (Locally redundant or Geo-redundant).
Click Review + create, then create.
Step 2: Define a Backup Policy
Open your newly created Backup Vault.
Under Policies, select Backup policies, then click + Add.
Set Datasource type to Azure Database for PostgreSQL flexible servers.
Provide a Policy Name (e.g.,
daily-weekly-postgresql-policy).On the Schedule + retention tab:
Configure the Backup Frequency (Weekly, Monthly, or Yearly).
Define retention durations (e.g., retain weekly backups for 12 weeks, annual backups for 5 years).
Click Create.
Step 3: Enable Protection on the Server
Return to your Azure Database for PostgreSQL flexible server instance.
On the left menu under Settings, select LTR (Vaulted Backups).
Click + Configure protection (or Configure Backup).
Choose your Backup Vault and the Backup Policy created in the previous step.
Grant RBAC Permissions:
Azure Backup requires Managed Identity permissions on your PostgreSQL server to execute dumps.
The Portal will run an automated validation check. If roles are missing, click Assign missing roles directly in the configuration wizard.
Once permission status shows Success, click Configure backup to complete registration.
4. Monitoring Backup Health and Storage
To ensure backups complete successfully and do not cause unforeseen storage costs:
Monitor Operational Storage Consumption: Navigate to your PostgreSQL server > Monitoring > Metrics. Select the metric Backup Storage Used. This reflects the total space consumed by retaining daily snapshots and WAL archives.
Track Vaulted Backup Jobs: Go to Backup center > Jobs (or Backup Vault > Backup Jobs). Filter by Datasource type = Azure Database for PostgreSQL flexible servers to view real-time execution logs, duration, and status for all scheduled and manual vault operations.
Best Practices Checklist
Test Point-In-Time Restoration Periodically: Validate recovery objectives (RTO/RPO) by staging point-in-time restores into a sandbox environment quarterly.
Align Retention with Regulatory Requirements: Maintain 7–14 days in the operational tier for cost efficiency, delegating multi-year retention entirely to Vaulted Backups.
Lock Backup Vaults Against Accidental Deletion: Enable Resource Locks (
CanNotDelete) and Soft Delete / Immutability on your Backup Vaults to safeguard against accidental deletion or ransomware threats.

Join the conversation! Your thoughts help the community grow.