Azure Database for PostgreSQL servers - az postgres server

Commands to manage Azure Database for PostgreSQL servers.

Commands

az postgres server configuration Commands to configure an Azure Database for PostgreSQL server.
az postgres server configuration list List the configurations of an Azure Database for PostgreSQL server.
az postgres server configuration set Update the configuration of an Azure Database for PostgreSQL server.
az postgres server configuration show Show the configuration of an Azure Database for PostgreSQL server.
az postgres server create Create an Azure Database for PostgreSQL server.
az postgres server delete Delete an Azure Database for PostgreSQL server.
az postgres server firewall-rule Commands to manage firewall rules 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 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 list List all the Azure Database for PostgreSQL servers belong to given resource group or subscription.
az postgres server restore Create a new Azure Database for PostgreSQL server by restoring from a server backup.
az postgres server show Show the details of an Azure Database for PostgreSQL server.
az postgres server update Update an Azure Database for PostgreSQL server.

az postgres server create

Create an Azure Database for PostgreSQL server.

az postgres server create --admin-user
--name
--resource-group
[--admin-password]
[--compute-units]
[--location]
[--performance-tier {Basic, Standard}]
[--ssl-enforcement {Disabled, Enabled}]
[--storage-size]
[--tags]
[--version]

Examples

Create server testsvr with only required paramaters in North Europe.

az postgres server create -l northeurope -g testgroup -n testsvr -u username -p password

Create server testsvr with specified performance tier and compute units in North Europe.

az postgres server create -l northeurope -g testgroup -n testsvr -u username -p password --performance-tier Standard --compute-units 100

Create server testsvr with all paramaters

az postgres server create -l northeurope -g testgroup -n testsvr -u username -p password --performance-tier Basic --compute-units 100 --ssl-enforcement Disabled --storage-size 51200 --tags "key=value" --version 

Required Parameters

--admin-user -u

The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).

--name -n

Name of the server.

--resource-group -g

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

Optional Parameters

--admin-password -p

The password of the administrator login.

--compute-units

Number of compute units.

--location -l

Location. You can configure the default location using az configure --defaults location=.

--performance-tier

The performance tier of the server.

accepted values: Basic, Standard
--ssl-enforcement

Enable ssl enforcement or not when connect to server.

accepted values: Disabled, Enabled
--storage-size

The max storage size of the server, unit is MB.

--tags

Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

--version

Server version.

az postgres server delete

Delete an Azure Database for PostgreSQL server.

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

Required Parameters

--name -n

Name of the server.

--resource-group -g

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

Optional Parameters

--yes -y

Do not prompt for confirmation.

az postgres server list

List all the Azure Database for PostgreSQL servers belong to given resource group or subscription.

az postgres server list [--resource-group]

Examples

List all servers in resource group.

az postgres server list -g testgroup

List all servers in subscription.

az postgres server list

Optional Parameters

--resource-group -g

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

az postgres server restore

Create a new Azure Database for PostgreSQL server by restoring from a server backup.

az postgres server restore --name
--resource-group
--restore-point-in-time
--source-server

Examples

Restore to server testsvrnew from server testsvr.

az postgres server restore -g testgroup -n testsvrnew --source-server testsvr --restore-point-in-time "2017-06-15T13:10:00Z"

Restore to server testsvrnew from server testsvr2 which is in a different resource group.

az postgres server restore -g testgroup -n testsvrnew -s "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/othergroup/providers/Microsoft.DBforPostgreSQL/servers/testsvr2" --restore-point-in-time "2017-06-15T13:10:00Z"

Required Parameters

--name -n

Name of the server.

--resource-group -g

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

--restore-point-in-time

The point in time to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+08:00.

--source-server -s

The name or ID of the source server to restore from.

az postgres server show

Show the details of an Azure Database for PostgreSQL server.

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

Required Parameters

--name -n

Name of the server.

--resource-group -g

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

az postgres server update

Update an Azure Database for PostgreSQL server.

az postgres server update --name
--resource-group
[--add]
[--admin-password]
[--compute-units]
[--remove]
[--set]
[--ssl-enforcement {Disabled, Enabled}]
[--tags]

Examples

Update server's compute-units to 100.

az postgres server update -g testgroup -n testsvrnew --compute-units 100

Update server's tags.

az postgres server update -g testgroup -n testsvrnew --tags "k1=v1" "k2=v2"

Required Parameters

--name -n

Name of the server.

--resource-group -g

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

Optional Parameters

--add

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

--admin-password -p

The password of the administrator login.

--compute-units

Number of compute units.

--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=.

--ssl-enforcement

Enable ssl enforcement or not when connect to server.

accepted values: Disabled, Enabled
--tags

Space separated tags in 'key[=value]' format. Use "" to clear existing tags.