Azure Database for PostgreSQL
Azure Database for PostgreSQL Flexible Server hosts ION application stores that need relational or extension features, such as configuration stores and vector stores. This page covers the data-protection configuration of the server, its parameters, extensions, backups, and diagnostics.
New authoritative stores and projections SHOULD use Cosmos DB (ADR-0007) or Azure SQL (ADR-0022). A new PostgreSQL store needs a design reason recorded with its IaC.
Data the resource handles
- Application data owned by one service. It can include customer data, configuration, and embeddings derived from customer content.
- Vector embeddings are derived customer data. They follow the same residency, retention, and deletion rules as their source data.
Encryption at rest
- Storage, backups, and temporary files are encrypted at rest by the service.
- Microsoft-managed keys are the default. Customer-managed keys MUST NOT be used without a documented compliance driver, key lifecycle, outage impact, and recovery design. Customer-managed keys can only be chosen when the server is created.
- Only the extensions a service needs MUST be allowlisted in
azure.extensions. Extensions that export data or call external endpoints MUST NOT be allowlisted without a review.
Encryption in transit
require_secure_transportMUST beON.ssl_min_protocol_versionMUST beTLSv1.2or higher.TLSv1.3SHOULD be used where all clients support it.- Clients MUST connect with
sslmode=verify-full(or the driver equivalent) so the server certificate and host name are verified.
Identity and access
- The server MUST use Entra-only authentication: Entra authentication enabled, password authentication disabled.
- The Entra administrator MUST be an Entra group. Membership is limited to break-glass and platform operators.
- Applications MUST connect with a user-assigned managed identity mapped to
a database role (
pgaadauth_create_principal) (ADR-0013). - Database roles MUST be least privilege. Runtime identities get only the
privileges their service needs on its own schema. Runtime identities MUST
NOT be members of
azure_pg_admin. - Schema migrations SHOULD run under a separate migration identity, not the runtime identity.
Temporal’s SQL plugins cannot use Entra tokens. Temporal stores follow the bounded password exception on the MySQL page. The same exception would be needed if a Temporal store were placed on PostgreSQL.
Secrets
- With password authentication disabled, there are no database credentials to store. Entra access tokens are acquired at runtime by the managed identity and MUST NOT be cached beyond their lifetime or logged.
Backup and recovery
- Backup retention MUST be at least 7 days. Longer periods come from the approved data inventory.
- Geo-redundant backup SHOULD be enabled in
prd, so a backup copy is held in Switzerland West. This is a backup copy, not a DR capability. It can only be enabled when the server is created. - A geo-replica in Switzerland West is part of the planned warm spare (ADR-0017) and MUST NOT be described as available until it is deployed and tested.
- High availability MUST be zone redundant in
gmaandprd.apaandbtaMAY run without HA, including on Burstable compute. prdservers MUST have aCanNotDeleteresource lock or Terraformprevent_destroy.- Restores MUST be tested, with drills in
gma. See Data protection procedures.
Logging and redaction
- Diagnostic settings MUST send
PostgreSQLLogsto the Switzerland North Log Analytics workspace. Other categories MAY be enabled when needed. - Connection and DDL activity MUST be audited:
log_connectionsandlog_disconnectionsset toon.- Either
pgaudit(added toshared_preload_libraries, withpgaudit.logset toddl,role) orlog_statementset toddl.
- Statement logging MUST NOT capture DML literals or parameter values by
default:
log_statementMUST NOT bemodorall.log_min_duration_statementSHOULD be-1unless a bounded investigation needs it.log_parameter_max_lengthSHOULD be0.
- Query Store SHOULD capture parameterless query text
(
pg_qs.parameters_capture_modeset tocapture_parameterless_only). - Full query text or parameter capture MAY be enabled for a bounded period when query analysis needs it, for example for high-volume workloads. Record it as an exception and turn it off when the analysis is done.
- Data-access audit records required by
ADR-0021 are
written by the owning service to
IonAudit_CL.
Network exposure
- VNet integration (a delegated subnet) SHOULD be used where feasible. It can only be chosen when the server is created.
- With public access, private endpoints are the Phase 2 target (ADR-0016). Until then, the ZPA configuration in ADR-0025 applies.
- Firewall rules MUST allow only ZPA connector IPs and platform IPs.
0.0.0.0/0MUST NOT be allowed. - The “Allow public access from any Azure service” rule (
0.0.0.0–0.0.0.0) SHOULD NOT be created. If ZPA routing makes narrow IP rules impractical, it needs a recorded exception; Entra-only authentication stays enforced.
Configuration reference
Properties are on Microsoft.DBforPostgreSQL/flexibleServers and its
configurations child resources. Map them to
azurerm_postgresql_flexible_server* resources or azapi equivalents.
| Setting | Required value | Basis |
|---|---|---|
authConfig.activeDirectoryAuth | Enabled (active_directory_auth_enabled in azurerm) | ADR-0013 |
authConfig.passwordAuth | Disabled (password_auth_enabled in azurerm) | ADR-0013 |
require_secure_transport | ON | TLS on every hop |
ssl_min_protocol_version | TLSv1.2 or higher | TLS on every hop |
azure.extensions | Only extensions the service needs | Encryption and access |
backup.backupRetentionDays | At least 7 (backup_retention_days in azurerm) | Residency and recovery |
backup.geoRedundantBackup | Enabled in prd (SHOULD; creation only) (geo_redundant_backup_enabled in azurerm) | Residency and recovery |
highAvailability.mode | ZoneRedundant in gma and prd | ADR-0017 |
log_connections / log_disconnections | on | ADR-0021 |
pgaudit.log or log_statement | ddl,role or ddl | ADR-0021 |
pg_qs.parameters_capture_mode | capture_parameterless_only (SHOULD) | ADR-0021 |
firewallRules | ZPA connector and platform IPs only; no Azure-services rule without an exception | ADR-0025 |
| Resource lock | CanNotDelete in prd | Residency and recovery |