Share via


az cosmosdb mongocluster

Note

This reference is part of the cosmosdb-preview extension for the Azure CLI (version 2.17.1 or higher). The extension will automatically install the first time you run an az cosmosdb mongocluster command. Learn more about extensions.

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Mongo cluster.

Commands

Name Description Type Status
az cosmosdb mongocluster create

Create a Mongo cluster.

Extension Preview
az cosmosdb mongocluster delete

Delete a Mongo Cluster Resource.

Extension Preview
az cosmosdb mongocluster firewall

Mongo cluster firewall.

Extension Preview
az cosmosdb mongocluster firewall rule

Mongo cluster firewall rule.

Extension Preview
az cosmosdb mongocluster firewall rule create

Create a Mongo cluster firewall rule.

Extension Preview
az cosmosdb mongocluster firewall rule delete

Delete a Mongo cluster firewall rule.

Extension Preview
az cosmosdb mongocluster firewall rule list

Lists firewall rule on a Mongo cluster.

Extension Preview
az cosmosdb mongocluster firewall rule show

Get a Mongo cluster firewall rule.

Extension Preview
az cosmosdb mongocluster firewall rule update

Create a Mongo cluster firewall rule.

Extension Preview
az cosmosdb mongocluster list

List a Mongo Cluster Resource.

Extension Preview
az cosmosdb mongocluster show

Get a Mongo Cluster Resource.

Extension Preview
az cosmosdb mongocluster update

Update a Mongo cluster.

Extension Preview

az cosmosdb mongocluster create

Preview

Command group 'cosmosdb mongocluster' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a Mongo cluster.

az cosmosdb mongocluster create --administrator-login
                                --administrator-login-password
                                --cluster-name
                                --location
                                --resource-group
                                --server-version
                                --shard-node-count
                                --shard-node-disk-size-gb
                                --shard-node-ha {false, true}
                                --shard-node-tier
                                [--tags]

Examples

Create a Mongo cluster.

az cosmosdb mongocluster create \
--cluster-name MyCluster \
--resource-group MyResourceGroup \
--location MyLocation \
--administrator-login MyAdminUser \
--administrator-login-password MyAdminPassword \
--server-version 5.0 \
--shard-node-tier "M30" \
--shard-node-ha true \
--shard-node-disk-size-gb 128 \
--shard-node-count 2

Required Parameters

--administrator-login -a

The initial administrator user to be configured when a cluster is created.

--administrator-login-password -p

The initial administrator password to be configured when a cluster is created.

--cluster-name -c

Name of the Cosmos DB Mongo Cluster.

--location -l

Azure Location of the Cluster.

--resource-group -g

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

--server-version

The server version of the mongo cluster.

Default value: 5.0
--shard-node-count

The node count for mongo cluster.

Default value: 1
--shard-node-disk-size-gb -d

The node disk size for mongo cluster.

--shard-node-ha

If enabled the cluster has HA.

Accepted values: false, true
--shard-node-tier

The node tier for mongo cluster.

Optional Parameters

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb mongocluster delete

Preview

Command group 'cosmosdb mongocluster' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a Mongo Cluster Resource.

az cosmosdb mongocluster delete --cluster-name
                                --resource-group
                                [--yes]

Examples

Deletes a Mongo Cluster Resource. If the cluster does not exist a NoContent response is returned.

az cosmosdb mongocluster delete --cluster-name MyCluster --resource-group MyResourceGroup

Required Parameters

--cluster-name -c

Name of the Cosmos DB Mongo Cluster.

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

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb mongocluster list

Preview

Command group 'cosmosdb mongocluster' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List a Mongo Cluster Resource.

az cosmosdb mongocluster list [--resource-group]

Examples

Lists Mongo Cluster Resource list in a resource group.

az cosmosdb mongocluster list --resource-group MyResourceGroup

Lists a Mongo Cluster Resource list in the subscription.

az cosmosdb mongocluster list

Optional Parameters

--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb mongocluster show

Preview

Command group 'cosmosdb mongocluster' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get a Mongo Cluster Resource.

az cosmosdb mongocluster show --cluster-name
                              --resource-group

Examples

Gets a Mongo Cluster Resource. ProvisioningState tells the state of this cluster. If the cluster does not exist a NotFound response is returned.

az cosmosdb mongocluster show --cluster-name MyCluster --resource-group MyResourceGroup

Required Parameters

--cluster-name -c

Name of the Cosmos DB Mongo Cluster.

--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb mongocluster update

Preview

Command group 'cosmosdb mongocluster' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a Mongo cluster.

az cosmosdb mongocluster update --cluster-name
                                --resource-group
                                [--administrator-login]
                                [--administrator-login-password]
                                [--server-version]
                                [--shard-node-disk-size-gb]
                                [--shard-node-ha {false, true}]
                                [--shard-node-tier]
                                [--tags]

Examples

Update a Mongo cluster.

az cosmosdb mongocluster update \
--cluster-name MyCluster \
--resource-group MyResourceGroup \
--administrator-login MyAdminUser \
--administrator-login-password MyAdminPassword \
--server-version 5.0 \
--shard-node-tier "M30" \
--shard-node-ha true \
--shard-node-disk-size-gb 128

Required Parameters

--cluster-name -c

Name of the Cosmos DB Mongo Cluster.

--resource-group -g

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

Optional Parameters

--administrator-login -a

The initial administrator user to be configured when a cluster is created.

--administrator-login-password -p

The initial administrator password to be configured when a cluster is created.

--server-version

The server version of the mongo cluster.

--shard-node-disk-size-gb -d

The node disk size for mongo cluster.

--shard-node-ha

If enabled the cluster has HA.

Accepted values: false, true
--shard-node-tier

The node tier for mongo cluster.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.