Secure your Azure Database for PostgreSQL flexible server

Azure Database for PostgreSQL is a fully managed database service that provides built-in high availability, automated backups, and scaling capabilities. Securing your PostgreSQL database deployments helps protect sensitive data and meet compliance requirements.

This article guides you on how to secure your Azure Database for PostgreSQL flexible server deployment.

The security recommendations in this article implement Zero Trust principles: "Verify explicitly", "Use least privilege access", and "Assume breach". For comprehensive Zero Trust guidance, see the Zero Trust Guidance Center.

Network security

Network security controls help you reduce public exposure and integrate Azure Database for PostgreSQL flexible server into a segmented virtual network architecture.

Identity and access management

Identity and access controls help you centralize authentication, reduce credential exposure, and enforce least privilege across Azure management and PostgreSQL database access.

  • Use Microsoft Entra authentication: Prefer Microsoft Entra authentication for PostgreSQL flexible server to centralize identity controls and reduce dependency on local database passwords. For more information, see Microsoft Entra authentication with Azure Database for PostgreSQL.

  • Manage Microsoft Entra principals: Assign and review Microsoft Entra administrators, users, and groups for PostgreSQL flexible server so database access follows least privilege. For more information, see Manage Microsoft Entra roles in Azure Database for PostgreSQL.

  • Use managed identities for application access: Authenticate Azure-hosted applications to PostgreSQL flexible server with managed identities instead of storing credentials in application code or configuration. For more information, see Managed identities in Azure Database for PostgreSQL.

  • Enforce Conditional Access for PostgreSQL administrators: Apply Conditional Access policies such as multifactor authentication and compliant-device requirements to identities that administer PostgreSQL flexible servers and related Azure resources. For more information, see Common Conditional Access policy: Require MFA for Azure management.

  • Use SCRAM for local authentication: If local PostgreSQL users are required, use SCRAM authentication and strong password practices to reduce password compromise risk. For more information, see SCRAM authentication in Azure Database for PostgreSQL.

  • Manage local database roles: Use PostgreSQL roles and permissions to restrict database-level access to the objects and operations each user needs. For more information, see Manage users in Azure Database for PostgreSQL.

  • Implement Azure role-based access control (RBAC): Assign Azure RBAC roles only to identities that need to create, configure, monitor, or delete PostgreSQL flexible server resources. For more information, see Azure role-based access control.

Data protection

Azure Database for PostgreSQL encrypts primary servers, replicas, point-in-time recovery data, and backups at rest by using service-managed keys. Use the following customer-configurable controls when your workload requires stronger encryption governance or data-use protections.

Logging and monitoring

Logging and monitoring controls help you detect suspicious activity, investigate incidents, and keep PostgreSQL audit evidence available for operational and compliance workflows.

Compliance and governance

Compliance and governance controls help you apply consistent configuration, map PostgreSQL deployments to regulatory requirements, and keep security ownership visible at scale.

  • Enforce PostgreSQL security configuration with Azure Policy: Assign built-in policies for PostgreSQL flexible server controls such as private endpoints, public access restrictions, diagnostic logging, TLS, customer-managed keys, and geo-redundant backup. For more information, see Azure Policy built-ins for Azure Database for PostgreSQL.

  • Review compliance offerings for PostgreSQL: Map Azure Database for PostgreSQL flexible server to relevant compliance certifications and attestations before you process regulated data. For more information, see Compliance in Azure Database for PostgreSQL.

  • Apply resource locks to production servers: Use management locks on production PostgreSQL flexible servers and dependent resources to reduce accidental deletion or disruptive configuration changes. For more information, see Protect your Azure resources with a lock.

  • Tag PostgreSQL resources for governance: Apply tags such as workload, environment, data classification, owner, and compliance scope to PostgreSQL flexible servers and related resources so policy, inventory, and cost-management workflows can identify protected databases. For more information, see Use tags to organize your Azure resources.

Backup and recovery

Backup and recovery controls help you restore PostgreSQL data after accidental deletion, corruption, or regional disruption while meeting workload recovery objectives.

Next steps