az postgres server

Manage PostgreSQL servers.

Commands

az postgres server configuration Manage configuration values for a server.
az postgres server configuration list List the configuration values for a server.
az postgres server configuration set Update the configuration of a server.
az postgres server configuration show Get the configuration for a server.".
az postgres server create Create a server.
az postgres server delete Delete a server.
az postgres server firewall-rule Manage firewall rules for a server.
az postgres server firewall-rule create Create a new firewall rule for a server.
az postgres server firewall-rule delete Delete a firewall rule.
az postgres server firewall-rule list List all firewall rules for a server.
az postgres server firewall-rule show Get the details of a firewall rule.
az postgres server firewall-rule update Update a firewall rule.
az postgres server list List available servers.
az postgres server restore Restore a server from backup.
az postgres server show Get the details of a server.
az postgres server update Update a server.

az postgres server create

Create a 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 a PostgreSQL server with only required paramaters in North Europe.

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

Create a PostgreSQL server with a Standard performance tier and 100 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 a PostgreSQL server with all paramaters set.

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

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=<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 a 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=<name>`.

Optional Parameters

--yes -y
Do not prompt for confirmation.

az postgres server list

List available servers.

az postgres server list [--resource-group]

Examples

List all PostgreSQL servers in a subscription.

az postgres server list

List all PostgreSQL servers in a resource group.

az postgres server list -g testgroup

Optional Parameters

--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

az postgres server restore

Restore a server from backup.

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

Examples

Restore 'testsvr' as 'testsvrnew'.

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

Restore 'testsvr2' to 'testsvrnew', where 'testsvrnew' is in a different resource group than the backup.

az postgres server restore -g testgroup -n testsvrnew     -s "/subscriptions/{SubID}/resourceGroups/{ResourceGroup}/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=<name>`.
--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

Get the details of a 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=<name>`.

az postgres server update

Update a server.

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

Examples

Update a server's compute-units to 100.

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

Update a 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=<name>`.

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.