Jaa


az cosmosdb table role assignment

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 table role assignment command. Learn more about extensions.

Manage Azure Cosmos DB Table role assignments.

Commands

Name Description Type Status
az cosmosdb table role assignment create

Create a Table role assignment under an Azure Cosmos DB account.

Extension GA
az cosmosdb table role assignment delete

Delete a Table role assignment under an Azure Cosmos DB account.

Extension GA
az cosmosdb table role assignment exists

Check if an Azure Cosmos DB role assignment exists.

Extension GA
az cosmosdb table role assignment list

List all Table role assignments under an Azure Cosmos DB account.

Extension GA
az cosmosdb table role assignment show

Show the properties of a Table role assignment under an Azure Cosmos DB account.

Extension GA
az cosmosdb table role assignment update

Update a Table role assignment under an Azure Cosmos DB account.

Extension GA

az cosmosdb table role assignment create

Create a Table role assignment under an Azure Cosmos DB account.

az cosmosdb table role assignment create --account-name
                                         --principal-id
                                         --resource-group
                                         --scope
                                         [--role-assignment-id]
                                         [--role-definition-id]
                                         [--role-definition-name]

Examples

Create a Table role assignment under an Azure Cosmos DB account using Role Definition Name.

az cosmosdb table role assignment create --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-name "My Read Only Role" \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

Create a Table role assignment under an Azure Cosmos DB account using Role Definition ID.

az cosmosdb table role assignment create --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-id be79875a-2cc4-40d5-8958-566017875b39 \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

Required Parameters

--account-name -a

Cosmosdb account name.

--principal-id -p

AAD Object ID of the principal to which this Role Assignment is being granted.

--resource-group -g

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

--scope -s

Data plane resource path at which this Role Assignment is being granted.

Optional Parameters

--role-assignment-id -i

Optional for Create. Unique ID for the Role Assignment. If not provided, a new GUID will be used.

--role-definition-id -d

Unique ID of the Role Definition that this Role Assignment refers to.

--role-definition-name -n

Unique Name of the Role Definition that this Role Assignment refers to. Eg. 'Contoso Reader Role'.

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 table role assignment delete

Delete a Table role assignment under an Azure Cosmos DB account.

az cosmosdb table role assignment delete --account-name
                                         --resource-group
                                         --role-assignment-id
                                         [--yes]

Examples

Delete a Table role assignment under an Azure Cosmos DB account.

az cosmosdb table role assignment delete --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8

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

--role-assignment-id -i

Optional for Create. Unique ID for the Role Assignment. If not provided, a new GUID will be used.

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 table role assignment exists

Check if an Azure Cosmos DB role assignment exists.

az cosmosdb table role assignment exists --account-name
                                         --resource-group
                                         --role-assignment-id

Examples

Check if an Azure Cosmos DB role assignment exists.

az cosmosdb table role assignment exists --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8

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

--role-assignment-id -i

Optional for Create. Unique ID for the Role Assignment. If not provided, a new GUID will be used.

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 table role assignment list

List all Table role assignments under an Azure Cosmos DB account.

az cosmosdb table role assignment list --account-name
                                       --resource-group

Examples

List all Table role assignments under an Azure Cosmos DB account.

az cosmosdb table role assignment 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 table role assignment show

Show the properties of a Table role assignment under an Azure Cosmos DB account.

az cosmosdb table role assignment show --account-name
                                       --resource-group
                                       --role-assignment-id

Examples

Show the properties of a Table role assignment under an Azure Cosmos DB account.

az cosmosdb table role assignment show --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8

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

--role-assignment-id -i

Optional for Create. Unique ID for the Role Assignment. If not provided, a new GUID will be used.

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 table role assignment update

Update a Table role assignment under an Azure Cosmos DB account.

az cosmosdb table role assignment update --account-name
                                         --principal-id
                                         --resource-group
                                         --scope
                                         [--role-assignment-id]
                                         [--role-definition-id]
                                         [--role-definition-name]

Examples

Update a Table role assignment under an Azure Cosmos DB account using Role Definition Name.

az cosmosdb table role assignment update --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-name "My Read Only Role" \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

update a Table role assignment under an Azure Cosmos DB account using Role Definition ID.

az cosmosdb table role assignment update --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-id be79875a-2cc4-40d5-8958-566017875b39 \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

Required Parameters

--account-name -a

Cosmosdb account name.

--principal-id -p

AAD Object ID of the principal to which this Role Assignment is being granted.

--resource-group -g

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

--scope -s

Data plane resource path at which this Role Assignment is being granted.

Optional Parameters

--role-assignment-id -i

Optional for Create. Unique ID for the Role Assignment. If not provided, a new GUID will be used.

--role-definition-id -d

Unique ID of the Role Definition that this Role Assignment refers to.

--role-definition-name -n

Unique Name of the Role Definition that this Role Assignment refers to. Eg. 'Contoso Reader Role'.

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.