az cosmosdb mongodb role 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 role definitions.

Commands

Name Description Type Status
az cosmosdb mongodb role definition create

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

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

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

Extension GA
az cosmosdb mongodb role definition delete

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

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

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

Extension GA
az cosmosdb mongodb role definition exists

Check if an Azure Cosmos DB MongoDb role definition exists.

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

Check if an Azure Cosmos DB MongoDb role definition exists.

Extension GA
az cosmosdb mongodb role definition list

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

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

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

Extension GA
az cosmosdb mongodb role definition show

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

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

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

Extension GA
az cosmosdb mongodb role definition update

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

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

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

Extension GA

az cosmosdb mongodb role definition create

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

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

Examples

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

az cosmosdb mongodb role definition create --account-name MyAccount --resource-group MyResourceGroup --body '{
  "Id": "MyDB.My_Read_Only_Role",
  "RoleName": "My_Read_Only_Role",
  "Type": "CustomRole",
  "DatabaseName": "MyDB",
  "Privileges": [{
    "Resource": {
        "Db": "MyDB",
        "Collection": "MyCol"
      },
      "Actions": [
        "insert",
        "find"
      ]
  }],
  "Roles": [
    {
      "Role": "myInheritedRole",
      "Db": "MyTestDb"
    }
  ]
}'

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

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

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Role Definition body with Id (Optional for create), Type (Default is CustomRole), DatabaseName, Privileges, Roles. You can enter it as a string or as a file, e.g., --body @mongo-role_definition-body-file.json or --body "{"Id": "be79875a-2cc4-40d5-8958-566017875b39","RoleName": "MyRWRole","Type": "CustomRole""DatabaseName": "MyDb","Privileges": [ {"Resource": {"Db": "MyDB","Collection": "MyCol"},"Actions": ["insert","find"]}],"Roles": [ {"Role": "myInheritedRole","Db": "MyTestDb"}]}".

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

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

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

Examples

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

az cosmosdb mongodb role definition create --account-name MyAccount --resource-group MyResourceGroup --body '{
  "Id": "MyDB.My_Read_Only_Role",
  "RoleName": "My_Read_Only_Role",
  "Type": "CustomRole",
  "DatabaseName": "MyDB",
  "Privileges": [{
    "Resource": {
        "Db": "MyDB",
        "Collection": "MyCol"
      },
      "Actions": [
        "insert",
        "find"
      ]
  }],
  "Roles": [
    {
      "Role": "myInheritedRole",
      "Db": "MyTestDb"
    }
  ]
}'

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

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

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Role Definition body with Id (Optional for create), Type (Default is CustomRole), DatabaseName, Privileges, Roles. You can enter it as a string or as a file, e.g., --body @mongo-role_definition-body-file.json or --body "{ "Id": "be79875a-2cc4-40d5-8958-566017875b39", "RoleName": "MyRWRole", "Type": "CustomRole" "DatabaseName": "MyDb", "Privileges": [ {"Resource": {"Db": "MyDB","Collection": "MyCol"},"Actions": ["insert","find"]}], "Roles": [ {"Role": "myInheritedRole","Db": "MyTestDb"}] }".

--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 role definition delete

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

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

Examples

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

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

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

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

Examples

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

az cosmosdb mongodb role 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 Role 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 role definition exists

Check if an Azure Cosmos DB MongoDb role definition exists.

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

Examples

Check if an Azure Cosmos DB MongoDb role definition exists.

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

Check if an Azure Cosmos DB MongoDb role definition exists.

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

Examples

Check if an Azure Cosmos DB MongoDb role definition exists.

az cosmosdb mongodb role 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 Role 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 role definition list

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

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

Examples

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

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

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

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

Examples

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

az cosmosdb mongodb role 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 role definition show

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

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

Examples

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

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

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

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

Examples

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

az cosmosdb mongodb role 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 Role 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 role definition update

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

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

Examples

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

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

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Role Definition body with Id (Optional for create), Type (Default is CustomRole), DatabaseName, Privileges, Roles. You can enter it as a string or as a file, e.g., --body @mongo-role_definition-body-file.json or --body "{"Id": "be79875a-2cc4-40d5-8958-566017875b39","RoleName": "MyRWRole","Type": "CustomRole""DatabaseName": "MyDb","Privileges": [ {"Resource": {"Db": "MyDB","Collection": "MyCol"},"Actions": ["insert","find"]}],"Roles": [ {"Role": "myInheritedRole","Db": "MyTestDb"}]}".

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

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

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

Examples

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

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

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Role Definition body with Id (Optional for create), Type (Default is CustomRole), DatabaseName, Privileges, Roles. You can enter it as a string or as a file, e.g., --body @mongo-role_definition-body-file.json or --body "{ "Id": "be79875a-2cc4-40d5-8958-566017875b39", "RoleName": "MyRWRole", "Type": "CustomRole" "DatabaseName": "MyDb", "Privileges": [ {"Resource": {"Db": "MyDB","Collection": "MyCol"},"Actions": ["insert","find"]}], "Roles": [ {"Role": "myInheritedRole","Db": "MyTestDb"}] }".

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