Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

Latest commit

 

History

History
48 lines (32 loc) · 1.65 KB

File metadata and controls

48 lines (32 loc) · 1.65 KB

Open PostgreSQL server firewall to your IP address

postgres/open-firewall-to-your-ip/README.md

Prerequisites

This example assumes you have previously completed the following examples:

  1. Create an Azure Resource Group
  2. Create an Azure Database for PostgreSQL
  3. Install curl

Open PostgreSQL server firewall to your local IP address

To make it possible to communicate with your PostgreSQL server from your local IP address execute the following command lines:

  export LOCAL_IP=`curl -s whatismyip.akamai.com`

  az postgres server firewall-rule create \
    --resource-group $RESOURCE_GROUP \
    --server-name $POSTGRESQL_NAME \
    --name AllowMyLocalIP \
    --start-ip-address $LOCAL_IP \
    --end-ip-address $LOCAL_IP

Cleanup

Do NOT forget to remove the resources once you are done running the example.

1m