az cosmosdb mongodb user definition

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Manage Azure Cosmos DB Mongo user definitions.

Commands

Name Description Type Status
az cosmosdb mongodb user definition create

Create a Mongo DB user definition under an Azure Cosmos DB account.

Core GA
az cosmosdb mongodb user definition create (cosmosdb-preview extension)

Create a Mongo DB user definition under an Azure Cosmos DB account.

Extension GA
az cosmosdb mongodb user definition delete

Delete a CosmosDb MongoDb user definition under an Azure Cosmos DB account.

Core GA
az cosmosdb mongodb user definition delete (cosmosdb-preview extension)

Delete a CosmosDb MongoDb user definition under an Azure Cosmos DB account.

Extension GA
az cosmosdb mongodb user definition exists

Check if an Azure Cosmos DB MongoDb user definition exists.

Core GA
az cosmosdb mongodb user definition exists (cosmosdb-preview extension)

Check if an Azure Cosmos DB MongoDb user definition exists.

Extension GA
az cosmosdb mongodb user definition list

List all MongoDb user definitions under an Azure Cosmos DB account.

Core GA
az cosmosdb mongodb user definition list (cosmosdb-preview extension)

List all MongoDb user definitions under an Azure Cosmos DB account.

Extension GA
az cosmosdb mongodb user definition show

Show the properties of a MongoDb user definition under an Azure Cosmos DB account.

Core GA
az cosmosdb mongodb user definition show (cosmosdb-preview extension)

Show the properties of a MongoDb user definition under an Azure Cosmos DB account.

Extension GA
az cosmosdb mongodb user definition update

Update a MongoDb user definition under an Azure Cosmos DB account.

Core GA
az cosmosdb mongodb user definition update (cosmosdb-preview extension)

Update a MongoDb user definition under an Azure Cosmos DB account.

Extension GA

az cosmosdb mongodb user definition create

Create a Mongo DB user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition create --account-name
                                           --body
                                           --resource-group

Examples

Create a Mongo DB user definition under an Azure Cosmos DB account using a JSON string.

az cosmosdb mongodb user definition create --account-name MyAccount --resource-group MyResourceGroup --body '{
  "Id": "MyDB.MyUName",
  "UserName": "MyUName",
  "Password": "MyPass",
  "DatabaseName": "MyDB",
  "CustomData": "TestCustomData",
  "Mechanisms": "SCRAM-SHA-256",
  "Roles": [
    {
      "Role": "myReadRole",
      "Db": "MyDB"
    }
  ]
}'

Create a Mongo DB user definition under an Azure Cosmos DB account using a JSON file.

az cosmosdb mongodb user definition create --account-name MyAccount --resource-group MyResourceGroup --body @mongo-user-definition.json

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

User Definition body with Id (Optional for create), UserName, Password, DatabaseName, CustomData, Mechanisms, Roles. You can enter it as a string or as a file, e.g., --body @mongo-user_definition-body-file.json or --body "{"Id": "be79875a-2cc4-40d5-8958-566017875b39","UserName": "MyUserName","Password": "MyPass","CustomData": "MyCustomData","Mechanisms": "SCRAM-SHA-256""DatabaseName": "MyDb","Roles": [ {"Role": "myReadRole","Db": "MyDb"}]}".

--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 mongodb user definition create (cosmosdb-preview extension)

Create a Mongo DB user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition create --account-name
                                           --body
                                           --resource-group

Examples

Create a Mongo DB user definition under an Azure Cosmos DB account using a JSON string.

az cosmosdb mongodb user definition create --account-name MyAccount --resource-group MyResourceGroup --body '{
  "Id": "MyDB.MyUName",
  "UserName": "MyUName",
  "Password": "MyPass",
  "DatabaseName": "MyDB",
  "CustomData": "TestCustomData",
  "Mechanisms": "SCRAM-SHA-256",
  "Roles": [
    {
      "Role": "myReadRole",
      "Db": "MyDB"
    }
  ]
}'

Create a Mongo DB user definition under an Azure Cosmos DB account using a JSON file.

az cosmosdb mongodb user definition create --account-name MyAccount --resource-group MyResourceGroup --body @mongo-user-definition.json

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

User Definition body with Id (Optional for create), UserName, Password, DatabaseName, CustomData, Mechanisms, Roles. You can enter it as a string or as a file, e.g., --body @mongo-user_definition-body-file.json or --body "{ "Id": "be79875a-2cc4-40d5-8958-566017875b39", "UserName": "MyUserName", "Password": "MyPass", "CustomData": "MyCustomData", "Mechanisms": "SCRAM-SHA-256" "DatabaseName": "MyDb", "Roles": [ {"Role": "myReadRole","Db": "MyDb"}] }".

--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 mongodb user definition delete

Delete a CosmosDb MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition delete --account-name
                                           --id
                                           --resource-group
                                           [--yes]

Examples

Delete a Mongo user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition delete --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--id -i

Unique ID for the Mongo User Definition.

--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 mongodb user definition delete (cosmosdb-preview extension)

Delete a CosmosDb MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition delete --account-name
                                           --id
                                           --resource-group
                                           [--yes]

Examples

Delete a Mongo user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition delete --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--id -i

Unique ID for the Mongo User Definition.

--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 mongodb user definition exists

Check if an Azure Cosmos DB MongoDb user definition exists.

az cosmosdb mongodb user definition exists --account-name
                                           --id
                                           --resource-group

Examples

Check if an Azure Cosmos DB MongoDb user definition exists.

az cosmosdb mongodb user definition exists --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--id -i

Unique ID for the Mongo User Definition.

--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 mongodb user definition exists (cosmosdb-preview extension)

Check if an Azure Cosmos DB MongoDb user definition exists.

az cosmosdb mongodb user definition exists --account-name
                                           --id
                                           --resource-group

Examples

Check if an Azure Cosmos DB MongoDb user definition exists.

az cosmosdb mongodb user definition exists --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--id -i

Unique ID for the Mongo User Definition.

--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 mongodb user definition list

List all MongoDb user definitions under an Azure Cosmos DB account.

az cosmosdb mongodb user definition list --account-name
                                         --resource-group

Examples

List all Mongodb user definitions under an Azure Cosmos DB account.

az cosmosdb mongodb user definition list --account-name MyAccount --resource-group MyResourceGroup

Required Parameters

--account-name -a

Cosmosdb account name.

--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 mongodb user definition list (cosmosdb-preview extension)

List all MongoDb user definitions under an Azure Cosmos DB account.

az cosmosdb mongodb user definition list --account-name
                                         --resource-group

Examples

List all Mongodb user definitions under an Azure Cosmos DB account.

az cosmosdb mongodb user definition list --account-name MyAccount --resource-group MyResourceGroup

Required Parameters

--account-name -a

Cosmosdb account name.

--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 mongodb user definition show

Show the properties of a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition show --account-name
                                         --id
                                         --resource-group

Examples

Show the properties of a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition show --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--id -i

Unique ID for the Mongo User Definition.

--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 mongodb user definition show (cosmosdb-preview extension)

Show the properties of a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition show --account-name
                                         --id
                                         --resource-group

Examples

Show the properties of a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition show --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--id -i

Unique ID for the Mongo User Definition.

--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 mongodb user definition update

Update a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition update --account-name
                                           --body
                                           --resource-group

Examples

Update a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition update --account-name MyAccount --resource-group MyResourceGroup --body @mongo-user-definition.json

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

User Definition body with Id (Optional for create), UserName, Password, DatabaseName, CustomData, Mechanisms, Roles. You can enter it as a string or as a file, e.g., --body @mongo-user_definition-body-file.json or --body "{"Id": "be79875a-2cc4-40d5-8958-566017875b39","UserName": "MyUserName","Password": "MyPass","CustomData": "MyCustomData","Mechanisms": "SCRAM-SHA-256""DatabaseName": "MyDb","Roles": [ {"Role": "myReadRole","Db": "MyDb"}]}".

--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 mongodb user definition update (cosmosdb-preview extension)

Update a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition update --account-name
                                           --body
                                           --resource-group

Examples

Update a MongoDb user definition under an Azure Cosmos DB account.

az cosmosdb mongodb user definition update --account-name MyAccount --resource-group MyResourceGroup --body @mongo-user-definition.json

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

User Definition body with Id (Optional for create), UserName, Password, DatabaseName, CustomData, Mechanisms, Roles. You can enter it as a string or as a file, e.g., --body @mongo-user_definition-body-file.json or --body "{ "Id": "be79875a-2cc4-40d5-8958-566017875b39", "UserName": "MyUserName", "Password": "MyPass", "CustomData": "MyCustomData", "Mechanisms": "SCRAM-SHA-256" "DatabaseName": "MyDb", "Roles": [ {"Role": "myReadRole","Db": "MyDb"}] }".

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