Edit

Add firewall rules

When you enable public access, set up firewall rules that allow connections from specific IP addresses or from any Azure service.

Using the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

  2. In the resource menu, under the Settings section, select Networking.

    Screenshot showing the Networking page.

  3. To create a firewall rule that allows connections from the public IP address of the client machine you're using to connect to the portal, select Add current client IP address (###.###.###.###).

    Screenshot showing how to add a firewall rule to allow connections from the IP address of the computer from which you're navigating the Azure portal.

  4. Add a new firewall rule to the grid. The portal automatically generates the Firewall rule name, but you can change it to any valid name you prefer. Set the Start IP address and End IP address to the public IP address from which you're connected to the Azure portal.

    Screenshot showing a new rule added to allow connections from the IP address of the computer from which you're navigating the Azure portal.

  5. To create a firewall rule that allows connections from any public IP address, select Add 0.0.0.0 / 255.255.255.255.

    Screenshot showing how to add a firewall rule to allow connections from all public IP addresses.

  6. To create a firewall rule that allows connections from any IP address allocated to any Azure service or asset, select Allow public access from any Azure service within Azure to this server.

    Screenshot showing how to add a firewall rule to allow connections from any Azure service.

    Important

    Allow public access from any Azure service within Azure to this server creates a firewall rule whose start and end IP addresses are set to 0.0.0.0. The presence of this rule configures the firewall to allow connections from IP addresses allocated to any Azure service or asset, including connections from the subscriptions of other customers.

  7. Select Save.

    Screenshot showing the Save button.

  8. A notification informs you that the changes are being applied.

    Screenshot showing a server whose network settings are being saved.

  9. When the process completes, a notification informs you that the changes were applied.

    Screenshot showing a server whose network settings were successfully saved.