Edit

Share via


Enable public access

This article explains how to enable public network access on an Azure Database for PostgreSQL flexible server. Public access allows connections from the internet using a public IP address, which you can secure with firewall rules and private endpoints.

Prerequisites

Before you begin, verify that your server meets the following requirements:

  • Server deployed with public access networking mode: You can only enable or disable public access on servers that you originally deployed with the Public access (allowed IP addresses) networking option.

  • Server status is Ready: The server must be in a Ready state before you can modify networking settings.

Important

This article doesn't apply to servers configured with private access (VNet Integration). The networking mode is a permanent setting chosen during server creation. If your server's Networking page shows Private access (VNet Integration) as the connectivity method, you can't enable public access on that server.

To switch from private access to public access, you must either:

  • Create a new server with the Public access (allowed IP addresses) networking option selected during deployment.
  • Restore the server to a new instance with public access enabled.

For more information about the differences between networking modes, see Private access (VNet Integration) and Public access (allowed IP addresses).

Determine your server's networking mode

To check which networking mode your server uses:

  1. In the Azure portal, navigate to your Azure Database for PostgreSQL flexible server.
  2. In the resource menu, select Networking.
  3. Check the Connectivity method section at the top of the page:
    • Public access (allowed IP addresses): This article applies to your server. Continue with the steps in this article.
    • Private access (VNet Integration): This article doesn't apply. See the Prerequisites section for your options.

Enable public access

When you enable public access:

  • The server accepts connections from IP addresses allowed by your firewall rules.
  • You can also connect through private endpoints.
  • Any previously configured firewall rules are automatically enforced.
  1. In the Azure portal, navigate to your Azure Database for PostgreSQL flexible server.
  2. In the resource menu, select Networking.
  3. Under Public access, select the Allow public access to this resource through the internet using a public IP address checkbox.
  4. Select Save.
  5. Wait for the server status to change from Updating to Ready. A notification confirms when the changes are applied.

Next steps

After you enable public access, configure firewall rules to control which IP addresses can connect to your server: