Databases PostgreSQL flexible server field-manual-complete

PostgreSQL public access

PostgreSQL public access means the flexible server has a public DNS name that can be reached over the internet, but only IP ranges you allow get a chance to connect. It is not anonymous access; users still need valid PostgreSQL credentials and encrypted connections. This option is useful when clients cannot use a virtual network, VPN, or ExpressRoute path. The important lesson is that public access is a controlled doorway, not a private network. The doorway needs tight firewall rules, ownership, and regular review.

Aliases
PostgreSQL public endpoint, PostgreSQL allowed IP addresses, PostgreSQL firewall access, Public access for PostgreSQL flexible server
Difficulty
fundamentals
CLI mappings
5
Last verified
2026-05-20T00:00:00Z

Microsoft Learn

In Azure Database for PostgreSQL flexible server, public access exposes a publicly resolvable endpoint but permits connections only from allowed IPv4 ranges configured as firewall rules. Clients still need valid database credentials, encrypted connections are enforced, and access is controlled at the server level.

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

Technical context

In Azure architecture, public access is the internet-reachable networking mode for Azure Database for PostgreSQL flexible server. The control plane stores firewall rules at the server level, and those rules apply to every database on that server. The data plane still requires PostgreSQL authentication and encrypted traffic. Public access can be paired with private endpoints on servers deployed in that networking mode, and it can be disabled when only private endpoint access should remain. It affects client IP planning, outbound address stability, monitoring, security reviews, and incident response.

Why it matters

Public access matters because it is often the fastest way to connect development tools, third-party services, branch offices, or workloads that cannot sit inside an Azure virtual network. That convenience creates risk if firewall rules are broad, stale, or owned by nobody. A single allowed range can expose the database to far more clients than intended, even though credentials are still required. Practitioners need to understand public access as a deliberate exception pattern: narrow IP ranges, named firewall rules, change records, periodic cleanup, and a migration path to private endpoints or private access when the workload matures or compliance requirements tighten.

Where you see it

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

Signal 01

In the PostgreSQL flexible server Networking blade, public access appears with firewall rules, allowed IP ranges, and the checkbox controlling internet reachability for the selected server.

Signal 02

Azure CLI firewall-rule list output shows rule names, start IP addresses, end IP addresses, and whether a broad range needs review or cleanup during access audits.

Signal 03

Application connection errors often include blocked host or missing pg_hba style messages when the client IP is not covered by a server-level rule for that client path.

When this becomes relevant

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

  • Connect a partner integration that has fixed outbound IPs but no VPN or ExpressRoute path.
  • Allow temporary DBA access from a controlled corporate egress range during migration rehearsal.
  • Support development or test databases where private networking is not yet justified by risk or cost.
  • Run a controlled transition while private endpoints are being rolled out and public access is scheduled for removal.
  • Troubleshoot external client connectivity by comparing firewall rules against the actual observed source IP.

Real-world case studies

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

Case study 01

Field telemetry partner onboarding

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

Scenario

An environmental consultancy collected water-quality telemetry from remote monitoring partners. The partners had fixed outbound IP addresses but no VPN relationship with the consultancy's Azure environment.

Business/Technical Objectives
  • Onboard partner ingestion without building a private network path for every station operator.
  • Restrict PostgreSQL connection attempts to approved partner egress IPs only.
  • Keep telemetry credentials separate from administrative database roles.
  • Review and expire access when field contracts changed.
Solution Using PostgreSQL public access

The platform owner kept PostgreSQL public access enabled for the ingestion server but created one named firewall rule per partner egress address. Each rule used a narrow single-address range and referenced the contract number in the change record. Partner applications connected with the PostgreSQL FQDN and a dedicated ingestion role that could write only to staging tables. Azure CLI exported firewall rules weekly and compared them against the partner registry. When a sensor operator changed network providers, operators replaced the old rule only after a test connection from the new static address. After ingestion completed, downstream processing copied validated data to internal analytics tables, leaving the public-access role with minimal privileges.

Results & Business Impact
  • Six partner operators were onboarded without new VPN circuits.
  • Firewall review time dropped from a manual spreadsheet day to a 20-minute CLI evidence check.
  • Two stale partner rules were removed before annual security assessment.
  • No administrative credentials were shared with external telemetry systems.
Key Takeaway for Glossary Readers

PostgreSQL public access can be acceptable when firewall ranges are narrow, named, reviewed, and paired with least-privilege database roles.

Case study 02

Design agency migration bridge

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

Scenario

A digital design agency migrated a scheduling platform from a hosted PostgreSQL provider to Azure. The legacy export tooling could connect only from a fixed office NAT address during migration weekends.

Business/Technical Objectives
  • Move production data without delaying the project for private network buildout.
  • Limit temporary database exposure to one corporate egress IP.
  • Remove migration access immediately after validation.
  • Produce evidence for customer security questionnaires.
Solution Using PostgreSQL public access

The Azure team deployed PostgreSQL flexible server with public access for the migration stage and created a firewall rule allowing only the agency's office NAT address. Migration credentials were stored in Key Vault and granted import permissions, not owner privileges. CLI scripts listed the firewall rules before the migration, created the temporary rule at the start of the approved window, and deleted it after row counts and application smoke tests passed. The final architecture used private endpoint connectivity for the production app, so public access was disabled after cutover. The team archived command output, timestamps, and validation reports with the change ticket.

Results & Business Impact
  • The migration finished over two weekends without emergency network engineering work.
  • The temporary firewall rule existed for less than 14 hours total.
  • Customer questionnaire evidence included exact IP range, timestamps, and deletion proof.
  • Production application traffic moved to private connectivity before launch.
Key Takeaway for Glossary Readers

Public access works best as a controlled bridge when the exit plan and cleanup evidence are designed before the first rule is created.

Case study 03

Municipal reporting portal access review

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

Scenario

A municipal technology office operated a permit reporting portal backed by PostgreSQL flexible server. Years of vendor support changes had left several public firewall rules with unclear ownership.

Business/Technical Objectives
  • Identify which public firewall rules were still required for reporting support.
  • Remove unknown and overly broad ranges without disrupting permit processing.
  • Teach support teams to request named, expiring access rules.
  • Create a quarterly evidence package for city cybersecurity leadership.
Solution Using PostgreSQL public access

Operators used Azure CLI to export all PostgreSQL public access rules, then compared rule names and IP ranges with vendor contracts, help-desk tickets, and observed login activity. Unknown ranges were disabled first in a staging copy, then removed from production during a maintenance window. Remaining rules were renamed to include owner and purpose, while support teams received a lightweight intake form requiring source IP, duration, and manager approval. The database roles were reviewed at the same time so firewall access did not imply broad query rights. A workbook tracked failed connection attempts after cleanup to catch any legitimate user who needed a narrower replacement rule.

Results & Business Impact
  • Public firewall rules dropped from 19 to 7 without a permit portal outage.
  • Three vendor ranges were narrowed from class-size blocks to fixed office egress addresses.
  • Quarterly review effort fell from two days to three hours.
  • Cybersecurity leadership accepted the rule inventory as repeatable evidence.
Key Takeaway for Glossary Readers

Public access becomes manageable only when firewall rules are owned, narrow, observable, and routinely removed when they stop being necessary.

Why use Azure CLI for this?

As an Azure engineer with ten years of production support, I use CLI for public access because firewall reviews are evidence-heavy. The portal is fine for one rule, but CLI lets me list every rule, export ranges, compare environments, and prove that a cleanup happened. It also keeps risky changes visible in automation. I can disable public access, create a named temporary rule, or remove a stale contractor range with a logged command and JSON output. That matters because public access changes can affect security posture immediately, even when the database itself remains healthy and ready for audits and rollbacks.

CLI use cases

  • List all public firewall rules and identify broad, stale, or unnamed ranges before an audit.
  • Create a narrowly scoped temporary firewall rule for a fixed corporate or partner source IP.
  • Delete a contractor, migration, or troubleshooting firewall rule after the approved window ends.
  • Show the server FQDN and network settings before diagnosing external client connection failures.
  • Disable public access on a public-mode server after private endpoint connectivity has been validated.

Before you run CLI

  • Confirm tenant, subscription, resource group, server name, requester, business reason, and exact source IPv4 range.
  • Verify the server was deployed with public access networking mode before trying to enable or disable public access.
  • Check whether the server is Ready; networking updates can be rejected or delayed while another operation is running.
  • Treat firewall creation, deletion, and public-access changes as security-impacting operations that require change evidence.
  • Use table output for quick rule review and JSON output when collecting rule IDs, ranges, and server state.

What output tells you

  • Firewall-rule output shows which source IP ranges can attempt to connect to every database on the server.
  • Server output shows the FQDN clients should use and whether public networking is enabled or disabled.
  • Rule names help identify ownership, purpose, and whether an access grant is temporary, production, or obsolete.
  • State and provisioningState values indicate whether a networking update is still applying or the server is ready.
  • JSON output makes it easier to compare production, staging, and development public exposure for drift reviews.

Mapped Azure CLI commands

PostgreSQL public access CLI Commands

direct
az postgres flexible-server show --name <server-name> --resource-group <resource-group> --query "{name:name,state:state,fullyQualifiedDomainName:fullyQualifiedDomainName,network:network}" --output json
az postgres flexible-serverdiscoverDatabases
az postgres flexible-server firewall-rule list --name <server-name> --resource-group <resource-group> --output table
az postgres flexible-server firewall-rulediscoverDatabases
az postgres flexible-server firewall-rule create --name <server-name> --resource-group <resource-group> --rule-name <rule-name> --start-ip-address <ip-address> --end-ip-address <ip-address>
az postgres flexible-server firewall-rulesecureDatabases
az postgres flexible-server firewall-rule delete --name <server-name> --resource-group <resource-group> --rule-name <rule-name>
az postgres flexible-server firewall-ruleremoveDatabases
az postgres flexible-server update --resource-group <resource-group> --name <server-name> --public-access disabled
az postgres flexible-serversecureDatabases

Architecture context

As an Azure architect, I use PostgreSQL public access only when the client placement justifies it. The design starts with identifying source IP ranges, NAT gateways, partner egress addresses, and whether those addresses are stable. I avoid the broad allow-Azure-services setting unless the risk has been explicitly accepted, because it can permit connections from Azure resources outside my subscription boundary. The server FQDN should be used instead of hard-coded IP addresses because public addresses can change. For mature production, I usually pair public access with private endpoints or design a future migration to private connectivity. The architecture decision should be recorded with owner, expiry, monitoring, and rollback expectations.

Security

Security impact is direct because public access creates an internet-routable endpoint guarded by firewall rules, authentication, and encryption. Firewall rules only decide whether a client can attempt a connection; they do not replace PostgreSQL roles, strong passwords, Microsoft Entra integration where applicable, TLS, secret rotation, or auditing. Risks include overly broad IP ranges, dynamic client addresses, stale contractor rules, allow-all-Azure exceptions, and leaked connection strings. Operators should review firewall rules like production access grants, not convenience settings. Security evidence should include rule names, IP ranges, owners, expiry dates, failed connection patterns, and proof that public access is disabled where only private endpoints are intended.

Cost

Cost impact is indirect. Public access does not create a separate database charge, but it can increase operational and security costs if rules are unmanaged. Broad exposure can lead to more security review, alert triage, penetration-test findings, and emergency cleanups. Stable outbound IPs may require NAT gateways, fixed partner egress, or network appliances outside the database bill. On the positive side, public access can avoid short-term VPN or ExpressRoute costs for low-risk development or partner integration. FinOps review should consider whether repeated firewall administration, audit evidence, and risk management now cost more than building private connectivity for production workloads sustainably.

Reliability

Reliability impact is mostly about reachability and operational predictability. Public access can keep remote clients working when no private route exists, but it depends on stable client egress IPs, DNS resolution, and firewall propagation. Dynamic home office addresses, changing NAT pools, or partner egress changes can look like a database outage. Firewall changes may take a few minutes to apply, so incident runbooks should not assume immediate effect. The server itself can be healthy while connections fail because a source IP is no longer allowed. Reliable use means documenting source networks, testing from each client path, and monitoring blocked connection symptoms alongside database health.

Performance

Performance impact is indirect and depends on network path. Public access does not change query execution, indexes, or database compute, but it can add latency through internet routing, NAT, proxy services, or distant clients. Using the FQDN helps clients follow current DNS resolution instead of stale IP assumptions. Public connectivity also affects operational speed: teams can test external integrations quickly, but troubleshooting can slow down when source IPs shift or firewall changes are pending. Operators should compare connection time, query latency, retry counts, and failed connection logs by client location before blaming PostgreSQL performance or scaling the server unnecessarily during incidents.

Operations

Operators inspect public access through the Networking blade, firewall-rule CLI commands, connection failures, and application source IP evidence. Day-to-day work includes adding named rules, removing stale ranges, proving why a rule exists, disabling public access when private endpoints take over, and troubleshooting pg_hba-style connection errors caused by blocked IPs. Automation should export the rule list, server public access setting, FQDN, and recent changes for review. Change tickets should include the requester, business reason, IP range, expected duration, and rollback. Good operators treat a firewall rule as access to production data, not a harmless connectivity shortcut during every review.

Common mistakes

  • Allowing a broad IP range because the real client egress address was not identified.
  • Using the allow-all-Azure option without realizing it can include Azure resources outside your own subscriptions.
  • Leaving temporary migration or vendor firewall rules active after the work is complete.
  • Assuming a firewall rule grants database permissions, when PostgreSQL credentials and roles still control authentication.
  • Hard-coding the resolved public IP instead of using the server FQDN in connection strings.