Databases PostgreSQL flexible server field-manual-complete

PostgreSQL private access

PostgreSQL private access means the flexible server is reached through private networking instead of an internet-facing endpoint. The server sits in a delegated subnet in a virtual network, and clients resolve its name through Private DNS. Apps in the same virtual network, peered networks, VPN, or ExpressRoute can connect if routing and security rules allow it. For a learner, the key idea is simple: choose private access when the database should behave like an internal service, not a public database with firewall openings.

Aliases
PostgreSQL private networking, PostgreSQL VNet integration, Private access for PostgreSQL flexible server, PostgreSQL delegated subnet access
Difficulty
intermediate
CLI mappings
5
Last verified
2026-05-20T00:00:00Z

Microsoft Learn

In Azure Database for PostgreSQL flexible server, private access uses virtual network integration to place the server inside a delegated subnet. Applications reach it through private IP networking, private DNS, peering, VPN, or ExpressRoute, and the server has no internet-accessible public endpoint.

Microsoft Learn: Networking overview with private access for Azure Database for PostgreSQL flexible server2026-05-20T00:00:00Z

Technical context

In Azure architecture, private access sits at the network boundary of Azure Database for PostgreSQL flexible server. It uses virtual network integration, a delegated subnet for Microsoft.DBforPostgreSQL/flexibleServers, and Private DNS zones ending in postgres.database.azure.com. It touches the control plane during provisioning, because the networking mode is chosen with the server, and the data plane during connections, because clients reach the server over private IP routes. It also affects peering, custom DNS, NSGs, route tables, replication, and HA traffic.

Why it matters

Private access matters because it turns database exposure into an architecture decision instead of a last minute firewall rule. A production PostgreSQL server often holds identity data, orders, patient records, telemetry, or financial state. If it is reachable only through private paths, teams reduce internet scanning exposure, simplify compliance conversations, and make application connectivity depend on owned network boundaries. It also forces better planning: subnet capacity, DNS resolution, peering, ExpressRoute, and route table exceptions need to be designed before deployment. The payoff is cleaner segmentation, fewer emergency firewall exceptions, and a database connection model that fits zero trust and landing-zone standards.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In the PostgreSQL flexible server Networking blade, the Connectivity method shows private access with the delegated subnet, Private DNS zone, and virtual network details used during provisioning.

Signal 02

Azure CLI server output exposes network fields such as delegatedSubnetResourceId and privateDnsZoneArmResourceId, confirming whether the server uses VNet integration during private connectivity troubleshooting and deployment reviews.

Signal 03

Deployment templates or Bicep files show the subnet resource ID, private DNS zone resource ID, and virtual network links required before applications resolve the database name.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Keep PostgreSQL reachable only from hub-spoke workloads and on-premises systems connected through VPN or ExpressRoute.
  • Migrate sensitive line-of-business data without opening public firewall rules during cutover.
  • Enforce landing-zone network segmentation by placing database traffic in a delegated subnet with audited DNS links.
  • Support AKS, VM, and App Service workloads that must connect to PostgreSQL over private routes.
  • Prepare HA, read replica, and restore designs that need predictable private name resolution and subnet capacity.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Aerospace supplier network isolation

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A precision aerospace supplier ran supplier schedules and inspection records in PostgreSQL flexible server. Its security team rejected public firewall rules because plants and partners connected through a hub network and ExpressRoute.

Business/Technical Objectives
  • Remove internet-reachable database exposure before the next compliance audit.
  • Allow plant applications and a partner portal to connect through approved private routes.
  • Keep database DNS consistent across hub, spoke, and on-premises networks.
  • Document the network path for incident response and vendor reviews.
Solution Using PostgreSQL private access

The platform team rebuilt the workload around PostgreSQL private access. The flexible server was created in a delegated subnet inside the data spoke, with a Private DNS zone linked to the hub, application spoke, and a test network. ExpressRoute already carried plant traffic into the hub, so firewall policies were adjusted to allow only approved application subnets to reach port 5432. Azure CLI scripts captured the server resource ID, subnet delegation, DNS zone, virtual network links, and server state after each deployment. Connection strings used the normal PostgreSQL FQDN, so application teams did not hard-code private IP addresses. A runbook covered DNS lookup tests, peering validation, failed connection triage, and emergency access through a hardened jump host.

Results & Business Impact
  • Public database exposure was removed from the audit finding list before quarter close.
  • Plant applications connected through private routes with no application hostname changes.
  • Mean connection troubleshooting time dropped from two hours to 35 minutes because DNS and subnet evidence was scripted.
  • Security reviewers approved the design for three additional supplier applications.
Key Takeaway for Glossary Readers

PostgreSQL private access turns database connectivity into a controlled network architecture instead of a collection of firewall exceptions.

Case study 02

University genomics workspace segmentation

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A university genomics center stored sequencing runs, sample metadata, and consent flags in PostgreSQL flexible server. Research VMs, batch pools, and data scientists needed access without placing sensitive metadata on a public endpoint.

Business/Technical Objectives
  • Keep human-subject metadata reachable only from approved research networks.
  • Support several compute workspaces without duplicating database servers.
  • Make DNS resolution work for custom Linux images and Azure-hosted workloads.
  • Provide security evidence for the institutional review board.
Solution Using PostgreSQL private access

The cloud team deployed PostgreSQL private access in a dedicated data subnet and linked the Private DNS zone to the research hub plus separate project spokes. Custom DNS forwarders sent postgres.database.azure.com queries to Azure DNS so Linux images could resolve the private address consistently. NSG rules allowed port 5432 only from approved compute subnets, while Key Vault held separate credentials for lab automation and analyst notebooks. Operators used Azure CLI to inventory the subnet delegation, DNS links, route tables, and server state before each semester intake. When a new lab joined, onboarding required a DNS test, network link request, database role request, and log review rather than a quick firewall opening.

Results & Business Impact
  • Five research workspaces shared one managed PostgreSQL service without exposing metadata publicly.
  • New lab onboarding shrank from ten manual steps to a repeatable two-day review.
  • DNS-related access tickets fell by 60 percent after the forwarder pattern was documented.
  • The review board received clear network, identity, and audit evidence for grant reporting.
Key Takeaway for Glossary Readers

Private access is especially valuable when many internal consumers need a shared database but public reachability is unacceptable.

Case study 03

Procurement SaaS private cutover

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A procurement SaaS provider modernized its order-matching platform on Azure. The web APIs were internet-facing, but customer bid history and supplier scoring data in PostgreSQL needed private-only reachability.

Business/Technical Objectives
  • Separate public API exposure from internal database connectivity.
  • Prepare a repeatable private network pattern for future customer environments.
  • Avoid emergency firewall rules during migration rehearsal and final cutover.
  • Verify rollback and restore connectivity before changing production traffic.
Solution Using PostgreSQL private access

The architecture team placed PostgreSQL private access in the application landing zone and connected Container Apps, deployment runners, and administrative jump hosts through private routes. The database subnet was delegated only to flexible server, and the Private DNS zone was linked to production and rehearsal spokes. Azure CLI checks ran in the deployment pipeline to confirm the server had no public endpoint, the DNS zone link existed, and the container environment could resolve the FQDN. The team rehearsed point-in-time restore into the same private network pattern so rollback would not require public access. During cutover, only application traffic changed; database firewall exceptions were not part of the plan.

Results & Business Impact
  • Production cutover finished inside a four-hour window with no emergency networking changes.
  • Security exceptions for database firewall access dropped to zero for the new platform.
  • Restore rehearsal confirmed private database reachability in 48 minutes.
  • The pattern became the baseline for eight later customer-facing services.
Key Takeaway for Glossary Readers

Private access gives SaaS teams a durable boundary between public application entry points and protected customer data stores.

Why use Azure CLI for this?

As an Azure engineer with ten years in production migrations, I prefer CLI for private access because the portal hides too much context. One command can show the server, subnet ID, DNS zone ID, and provisioning state. Another can verify subnet delegation and DNS zone links before an outage becomes a database blame game. CLI output is easy to paste into change tickets, compare across environments, and embed in deployment gates. It also keeps platform teams honest: if a private server cannot be recreated from scripted resource IDs, the network design is not mature enough for regulated production workloads today.

CLI use cases

  • Show the PostgreSQL server network configuration and confirm it is tied to the expected delegated subnet.
  • Verify the subnet delegation before creating or troubleshooting a private-access flexible server.
  • List Private DNS virtual network links to confirm app spokes can resolve the PostgreSQL FQDN.
  • Create a new private-access server with explicit VNet, subnet, and Private DNS zone arguments.
  • Export server, subnet, and DNS identifiers for change-review evidence or landing-zone drift checks.

Before you run CLI

  • Confirm tenant, subscription, resource group, server name, network resource group, VNet, subnet, region, and DNS zone ownership.
  • Verify the subnet is delegated to Microsoft.DBforPostgreSQL/flexibleServers and has enough address capacity for HA or replica growth.
  • Check permissions for PostgreSQL server operations, network reads, Private DNS reads, and any cross-subscription DNS zone registration.
  • Treat create, update, and delete commands as cost or outage impacting; use read-only show/list commands first.
  • Use JSON output when collecting evidence because network IDs, DNS zone IDs, and provisioning states are easier to compare.

What output tells you

  • The server network fields show whether the database uses delegated subnet routing and which Private DNS zone is associated.
  • The subnet output shows delegation, address prefixes, service endpoints, and whether the server subnet is dedicated correctly.
  • DNS zone and link output shows which virtual networks can resolve the PostgreSQL name without custom host-file workarounds.
  • ProvisioningState and state values reveal whether a failed deployment is still updating, ready, or stuck on a network dependency.
  • Resource IDs prove whether the server, subnet, and DNS zone are in the intended subscription and resource groups.

Mapped Azure CLI commands

PostgreSQL private access CLI Commands

direct
az postgres flexible-server show --name <server-name> --resource-group <resource-group> --query "{name:name,state:state,network:network,fullyQualifiedDomainName:fullyQualifiedDomainName}" --output json
az postgres flexible-serverdiscoverDatabases
az network vnet subnet show --resource-group <network-resource-group> --vnet-name <vnet-name> --name <subnet-name> --query "{id:id,addressPrefix:addressPrefix,delegations:delegations[].serviceName}" --output json
az network vnet subnetdiscoverDatabases
az network private-dns zone show --resource-group <dns-resource-group> --name <zone-name> --query "{name:name,numberOfRecordSets:numberOfRecordSets}" --output json
az network private-dns zonediscoverDatabases
az network private-dns link vnet list --resource-group <dns-resource-group> --zone-name <zone-name> --output table
az network private-dns link vnetdiscoverDatabases
az postgres flexible-server create --name <server-name> --resource-group <resource-group> --location <region> --vnet <vnet-name> --subnet <subnet-name> --private-dns-zone <dns-zone-name>
az postgres flexible-serverprovisionDatabases

Architecture context

As an Azure architect, I treat PostgreSQL private access as part of the landing-zone network design, not a checkbox on the database blade. The server needs a delegated subnet with enough addresses for HA, replicas, and future growth. Private DNS must be linked to every network that needs name resolution, including hub, spoke, and peered virtual networks. Route tables and NSGs should allow port 5432 inside the server subnet and the managed service dependencies required for storage, Microsoft Entra, and replication. When applications run in App Service, AKS, Container Apps, VMs, or on-premises, the connection path must be drawn and tested before cutover. Good design also documents who owns the subnet, DNS zone, firewall policy, and recovery path.

Security

Security impact is direct because private access removes the public endpoint and places database reachability behind network, DNS, identity, and PostgreSQL authentication controls. It does not make the database safe by itself. Operators still need strong credentials or Microsoft Entra integration where supported, least-privilege database roles, TLS, Key Vault secrets, restricted admin access, and audited changes. The main risks move to misconfigured peering, broad NSG rules, stale Private DNS links, route tables that break managed service dependencies, and unmanaged jump hosts. Security reviewers should verify which subnets can resolve and route to the server, who can change network settings, and whether incident responders can access the database without reopening public access.

Cost

Cost impact is indirect but real. Private access itself is part of the server networking choice, but the surrounding architecture can add private DNS zones, VPN gateways, ExpressRoute circuits, hub firewalls, peering, monitoring, and operational labor. It can also prevent expensive incident work by avoiding broad public firewall exceptions and reducing exposure-driven security findings. Subnet planning matters because rebuilding a server to change network mode is more costly than designing correctly. FinOps owners should track the database, private networking dependencies, DNS resources, route inspection, and support effort as one service footprint rather than treating the PostgreSQL server as the only billable component.

Reliability

Reliability impact is mostly about connection continuity and recovery reachability. Private access can improve resilience by keeping traffic on predictable private routes, but it also makes DNS, subnet capacity, routing, and network dependencies part of the database availability story. A broken Private DNS link, exhausted delegated subnet, misapplied NSG, or route table that blocks storage or Microsoft Entra traffic can make a healthy server unreachable. HA and read replicas still need allowed traffic inside the server subnet and across required regions. Reliable design means testing name resolution, port 5432 connectivity, failover, replica creation, restore procedures, and on-premises paths before the database becomes business critical.

Performance

Performance impact is usually indirect. Private access does not make PostgreSQL execute queries faster, but it affects connection path length, DNS lookup behavior, cross-region routing, firewall inspection, and application placement. When apps and databases are in the same virtual network or nearby peered networks, latency can be predictable. When traffic hairpins through custom DNS, firewalls, VPN, or ExpressRoute, poor routing can add delay or connection failures. Operators should measure connection time, query latency, retry spikes, and failover behavior from each client subnet. Good private access design keeps traffic paths simple, avoids unnecessary inspection hops, and places latency-sensitive applications close to the database.

Operations

Operators manage private access by inspecting the server networking model, delegated subnet, private DNS zone, virtual network links, peering, NSGs, and route tables. Troubleshooting usually starts with the client: can it resolve the server FQDN, route to the private address, and authenticate with the right database role? Then operators validate Azure control-plane state, server readiness, DNS records, subnet delegation, and recent network changes. Automation should export subnet IDs, DNS zone IDs, link names, and server resource IDs for audit evidence. Runbooks should cover new app onboarding, on-premises connectivity, HA failover checks, replica networking, restore networking, and safe retirement of unused private endpoints or DNS links.

Common mistakes

  • Creating a private server before the platform team has agreed on DNS ownership and virtual network link responsibilities.
  • Using a delegated subnet that is too small for HA, replicas, future restore testing, or multiple flexible servers.
  • Assuming virtual network peering automatically solves Private DNS resolution for every spoke network.
  • Blocking port 5432, storage, or Microsoft Entra dependencies with NSGs or route tables during hardening.
  • Expecting to switch an existing private-access deployment into a public-access server without redesigning the deployment.