Firewall rules for Azure Database for PostgreSQL servers - az postgres server firewall-rule

Commands to manage firewall rules for an Azure Database for PostgreSQL server.

Commands

az postgres server firewall-rule create Create a firewall rule for an Azure Database for PostgreSQL server.
az postgres server firewall-rule delete Delete a firewall rule for an Azure Database for PostgreSQL server.
az postgres server firewall-rule list List all the firewall rules for an Azure Database for PostgreSQL server.
az postgres server firewall-rule show Show the details of a firewall rule for an Azure Database for PostgreSQL server.
az postgres server firewall-rule update Update a firewall rule for an Azure Database for PostgreSQL server.

az postgres server firewall-rule create

Create a firewall rule for an Azure Database for PostgreSQL server.

az postgres server firewall-rule create --end-ip-address
--name
--resource-group
--server-name
--start-ip-address

Examples

Create a firewall rule for server testsvr.

az postgres server firewall-rule create -g testgroup -s testsvr -n allowall --start-ip-address 0.0.0.0 --end-ip-address 255.255.255.255

Required Parameters

--end-ip-address

The end IP address of the firewall rule. Must be IPv4 format.

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--server-name -s

Name of the server.

--start-ip-address

The start IP address of the firewall rule. Must be IPv4 format.

az postgres server firewall-rule delete

Delete a firewall rule for an Azure Database for PostgreSQL server.

az postgres server firewall-rule delete --name
--resource-group
--server-name
[--yes]

Required Parameters

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--server-name -s

Name of the server.

Optional Parameters

--yes -y

Do not prompt for confirmation.

az postgres server firewall-rule list

List all the firewall rules for an Azure Database for PostgreSQL server.

az postgres server firewall-rule list --resource-group
--server-name

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--server-name -s

Name of the server.

az postgres server firewall-rule show

Show the details of a firewall rule for an Azure Database for PostgreSQL server.

az postgres server firewall-rule show --name
--resource-group
--server-name

Required Parameters

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--server-name -s

Name of the server.

az postgres server firewall-rule update

Update a firewall rule for an Azure Database for PostgreSQL server.

az postgres server firewall-rule update --name
--resource-group
--server-name
[--add]
[--end-ip-address]
[--remove]
[--set]
[--start-ip-address]

Examples

Update firewall rule's start IP address.

az postgres server firewall-rule update -g testgroup -s testsvr -n allowall --start-ip-address 0.0.0.1

Update firewall rule's start and end IP address.

az postgres server firewall-rule update -g testgroup -s testsvr -n allowall --start-ip-address 0.0.0.1 --end-ip-address 255.255.255.254

Required Parameters

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--server-name -s

Name of the server.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty .

--end-ip-address

The end IP address of the firewall rule. Must be IPv4 format.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--start-ip-address

The start IP address of the firewall rule. Must be IPv4 format.