az cosmosdb postgres cluster
Manage Azure Cosmos DB for PostgreSQL clusters.
Commands
Name | Description | Type | Status |
---|---|---|---|
az cosmosdb postgres cluster create |
Create a new cluster with nodes. |
Core | GA |
az cosmosdb postgres cluster delete |
Delete a cluster together with nodes in it. |
Core | GA |
az cosmosdb postgres cluster list |
List all clusters in a subscription or a resource group. |
Core | GA |
az cosmosdb postgres cluster promote |
Promotes read replica cluster to an independent read-write cluster. |
Core | GA |
az cosmosdb postgres cluster restart |
Restarts all nodes in the cluster. |
Core | GA |
az cosmosdb postgres cluster server |
Manage Azure Cosmos DB for PostgreSQL cluster servers. |
Core | GA |
az cosmosdb postgres cluster server list |
List nodes of a cluster. |
Core | GA |
az cosmosdb postgres cluster server show |
Get information about a node in cluster. |
Core | GA |
az cosmosdb postgres cluster show |
Get information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time. |
Core | GA |
az cosmosdb postgres cluster start |
Starts stopped compute on all cluster nodes. |
Core | GA |
az cosmosdb postgres cluster stop |
Stops compute on all cluster nodes. |
Core | GA |
az cosmosdb postgres cluster update |
Update an existing cluster. The request body can contain one or several properties from the cluster definition. |
Core | GA |
az cosmosdb postgres cluster wait |
Place the CLI in a waiting state until a condition is met. |
Core | GA |
az cosmosdb postgres cluster create
Create a new cluster with nodes.
Use the following reference to determine supported values for various parameters for Azure Cosmos DB for PostgreSQL clusters and nodes CLI commands: https://learn.microsoft.com/rest/api/postgresqlhsc/#values.
az cosmosdb postgres cluster create --cluster-name
--resource-group
[--administrator-login-password]
[--citus-version]
[--coord-public-ip-access {0, 1, f, false, n, no, t, true, y, yes}]
[--coord-server-edition]
[--coordinator-storage]
[--coordinator-v-cores]
[--enable-ha {0, 1, f, false, n, no, t, true, y, yes}]
[--enable-shards-on-coord {0, 1, f, false, n, no, t, true, y, yes}]
[--location]
[--maintenance-window]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--node-count]
[--node-enable-public-ip-access {0, 1, f, false, n, no, t, true, y, yes}]
[--node-server-edition]
[--node-storage]
[--node-v-cores]
[--point-in-time-utc]
[--postgresql-version]
[--preferred-primary-zone]
[--source-location]
[--source-resource-id]
[--tags]
Examples
Create a new single node cluster
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 8 --coordinator-server-edition "GeneralPurpose" --coordinator-storage 131072 --enable-shards-on-coord true --node-count 0 --preferred-primary-zone "1" --administrator-login-password "password"
Create a new cluster as a point in time restore
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --point-in-time-utc "2017-12-14T00:00:37.467Z" --source-location "eastus" --source-resource-id "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"
Create a new cluster as a read replica
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --source-location "eastus" --source-resource-id "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"
Create a new multi-node cluster
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 8 --coordinator-server-edition "GeneralPurpose" --coordinator-storage 131072 --enable-shards-on-coord false --node-count 3 --node-server-edition "MemoryOptimized" --node-v-cores 8 --node-storage 131072 --postgresql-version "15" --preferred-primary-zone "1" --administrator-login-password "password"
Create a new single node Burstable 1 vCore cluster
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 1 --coordinator-server-edition "BurstableMemoryOptimized" --coord-public-ip-access true --coordinator-storage 131072 --enable-shards-on-coord true --node-count 0 --preferred-primary-zone "1" --administrator-login-password "password"
Create a new single node Burstable 2 vCores cluster
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 2 --coordinator-server-edition "BurstableGeneralPurpose" --coord-public-ip-access true --coordinator-storage 131072 --enable-shards-on-coord true --node-count 0 --preferred-primary-zone "1" --administrator-login-password "password"
Required Parameters
The name of the cluster.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The password of the administrator login. Required for creation. If value is blank it's asked from the tty.
The Citus extension version on all cluster servers.
If public access is enabled on coordinator.
The edition of a coordinator server (default: GeneralPurpose). Required for creation.
The storage of a server in MB. Required for creation. See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
The vCores count of a server (max: 96). Required for creation. See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
If high availability (HA) is enabled or not for the cluster.
If shards on coordinator is enabled or not for the cluster.
The geo-location where the resource lives When not specified, the location of the resource group will be used.
Maintenance window of a cluster. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Do not wait for the long-running operation to finish.
Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1. Required for creation.
If public access is enabled on worker nodes.
The edition of a node server (default: MemoryOptimized).
The storage in MB on each worker node. See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
The compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
Date and time in UTC (ISO8601 format) for cluster restore.
The major PostgreSQL version on all cluster servers.
Preferred primary availability zone (AZ) for all cluster servers.
The Azure region of source cluster for read replica clusters.
The resource id of source cluster for read replica clusters.
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster delete
Delete a cluster together with nodes in it.
az cosmosdb postgres cluster delete [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
[--yes]
Examples
Delete the cluster
az cosmosdb postgres cluster delete -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
The name of the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster list
List all clusters in a subscription or a resource group.
az cosmosdb postgres cluster list [--resource-group]
Examples
List clusters in a resource group
az cosmosdb postgres cluster list -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
List clusters in a subscription
az cosmosdb postgres cluster list --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster promote
Promotes read replica cluster to an independent read-write cluster.
az cosmosdb postgres cluster promote [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
Examples
Promote read replica cluster to an independent read-write cluster
az cosmosdb postgres cluster promote -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
The name of the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster restart
Restarts all nodes in the cluster.
az cosmosdb postgres cluster restart [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
Examples
Restart all servers in the cluster
az cosmosdb postgres cluster restart -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
The name of the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster show
Get information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time.
az cosmosdb postgres cluster show [--cluster-name]
[--ids]
[--resource-group]
[--subscription]
Examples
Show details of cluster
az cosmosdb postgres cluster show -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
The name of the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster start
Starts stopped compute on all cluster nodes.
az cosmosdb postgres cluster start [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
Examples
Start all servers in the cluster
az cosmosdb postgres cluster start -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
The name of the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster stop
Stops compute on all cluster nodes.
az cosmosdb postgres cluster stop [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
Examples
Stop all servers in the cluster
az cosmosdb postgres cluster stop -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
Optional Parameters
The name of the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster update
Update an existing cluster. The request body can contain one or several properties from the cluster definition.
Use the following reference to determine supported values for various parameters for Azure Cosmos DB for PostgreSQL clusters and nodes CLI commands: https://learn.microsoft.com/rest/api/postgresqlhsc/#values.
az cosmosdb postgres cluster update [--administrator-login-password]
[--citus-version]
[--cluster-name]
[--coord-public-ip-access {0, 1, f, false, n, no, t, true, y, yes}]
[--coord-server-edition]
[--coordinator-storage]
[--coordinator-v-cores]
[--enable-ha {0, 1, f, false, n, no, t, true, y, yes}]
[--enable-shards-on-coord {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--maintenance-window]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--node-count]
[--node-server-edition]
[--node-storage]
[--node-v-cores]
[--postgresql-version]
[--preferred-primary-zone]
[--resource-group]
[--subscription]
[--tags]
Examples
Scale worker node compute up or down
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-v-cores 16
Scale out: Add new worker nodes
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-count 2
Scale up worker node storage
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-storage 2097152
Update multiple configuration settings of the cluster
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-v-cores 16 --node-count 4 coordinator-v-cores 16 --administrator-login-password "newPassword"
Update or define maintenance window
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --maintenance-window day-of-week=1 start-hour=2 --start-minute=0 custom-window="Enabled"
Upgrade PostgreSQL major version
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --postgresql-version "15"
Scale up coordinator storage
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --coordinator-storage 2097152
Optional Parameters
The password of the administrator login. Required for creation. If value is blank it's asked from the tty.
The Citus extension version on all cluster servers.
The name of the cluster.
If public access is enabled on coordinator.
The edition of a coordinator server (default: GeneralPurpose). Required for creation.
The storage of a server in MB. Required for creation. See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
The vCores count of a server (max: 96). Required for creation. See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
If high availability (HA) is enabled or not for the cluster.
If shards on coordinator is enabled or not for the cluster.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Maintenance window of a cluster. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Do not wait for the long-running operation to finish.
Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1.
The edition of a node server (default: MemoryOptimized).
The storage in MB on each worker node. See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
The compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/rest/api/postgresqlhsc/#values for more information.
The major PostgreSQL version on all cluster servers.
Preferred primary availability zone (AZ) for all cluster servers.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Application-specific metadata in the form of key-value pairs. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb postgres cluster wait
Place the CLI in a waiting state until a condition is met.
az cosmosdb postgres cluster wait [--cluster-name]
[--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
Optional Parameters
The name of the cluster.
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Polling interval in seconds.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI