az cosmosdb mongodb role definition
Note
此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 Learn more about extensions.
管理 Azure Cosmos DB Mongo 角色定義。
命令
名稱 | Description | 類型 | 狀態 |
---|---|---|---|
az cosmosdb mongodb role definition create |
在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。 |
Core | GA |
az cosmosdb mongodb role definition create (cosmosdb-preview 擴充功能) |
在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。 |
Extension | GA |
az cosmosdb mongodb role definition delete |
刪除 Azure Cosmos DB 帳戶底下的 CosmosDb MongoDb 角色定義。 |
Core | GA |
az cosmosdb mongodb role definition delete (cosmosdb-preview 擴充功能) |
刪除 Azure Cosmos DB 帳戶底下的 CosmosDb MongoDb 角色定義。 |
Extension | GA |
az cosmosdb mongodb role definition exists |
檢查 Azure Cosmos DB MongoDb 角色定義是否存在。 |
Core | GA |
az cosmosdb mongodb role definition exists (cosmosdb-preview 擴充功能) |
檢查 Azure Cosmos DB MongoDb 角色定義是否存在。 |
Extension | GA |
az cosmosdb mongodb role definition list |
列出 Azure Cosmos DB 帳戶下的所有 MongoDb 角色定義。 |
Core | GA |
az cosmosdb mongodb role definition list (cosmosdb-preview 擴充功能) |
列出 Azure Cosmos DB 帳戶下的所有 MongoDb 角色定義。 |
Extension | GA |
az cosmosdb mongodb role definition show |
顯示 Azure Cosmos DB 帳戶下 MongoDb 角色定義的屬性。 |
Core | GA |
az cosmosdb mongodb role definition show (cosmosdb-preview 擴充功能) |
顯示 Azure Cosmos DB 帳戶下 MongoDb 角色定義的屬性。 |
Extension | GA |
az cosmosdb mongodb role definition update |
更新 Azure Cosmos DB 帳戶下的 MongoDb 角色定義。 |
Core | GA |
az cosmosdb mongodb role definition update (cosmosdb-preview 擴充功能) |
更新 Azure Cosmos DB 帳戶下的 MongoDb 角色定義。 |
Extension | GA |
az cosmosdb mongodb role definition create
在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。
az cosmosdb mongodb role definition create --account-name
--body
--resource-group
範例
使用 JSON 字串,在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。
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"
}
]
}'
使用 JSON 檔案,在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。
az cosmosdb mongodb role definition create --account-name MyAccount --resource-group MyResourceGroup --body @mongo-role-definition.json
必要參數
Cosmosdb 帳戶名稱。
具有標識符的角色定義主體(選擇性用於建立)、類型(預設值為 CustomRole)、DatabaseName、Privileges、Roles。 您可以將它輸入為字串或檔案,例如 --body @mongo-role_definition-body-file.json 或 --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“}]}”。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition create (cosmosdb-preview 擴充功能)
在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。
az cosmosdb mongodb role definition create --account-name
--body
--resource-group
範例
使用 JSON 字串,在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。
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"
}
]
}'
使用 JSON 檔案,在 Azure Cosmos DB 帳戶下建立 Mongo DB 角色定義。
az cosmosdb mongodb role definition create --account-name MyAccount --resource-group MyResourceGroup --body @mongo-role-definition.json
必要參數
Cosmosdb 帳戶名稱。
具有標識符的角色定義主體(選擇性用於建立)、類型(預設值為 CustomRole)、DatabaseName、Privileges、Roles。 您可以將它輸入為字串或檔案,例如 --body @mongo-role_definition-body-file.json 或 --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“}] }”。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition delete
刪除 Azure Cosmos DB 帳戶底下的 CosmosDb MongoDb 角色定義。
az cosmosdb mongodb role definition delete --account-name
--id
--resource-group
[--yes]
範例
刪除 Azure Cosmos DB 帳戶下的 Mongo 角色定義。
az cosmosdb mongodb role definition delete --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39
必要參數
Cosmosdb 帳戶名稱。
Mongo 角色定義的唯一標識碼。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
請勿提示確認。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition delete (cosmosdb-preview 擴充功能)
刪除 Azure Cosmos DB 帳戶底下的 CosmosDb MongoDb 角色定義。
az cosmosdb mongodb role definition delete --account-name
--id
--resource-group
[--yes]
範例
刪除 Azure Cosmos DB 帳戶下的 Mongo 角色定義。
az cosmosdb mongodb role definition delete --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39
必要參數
Cosmosdb 帳戶名稱。
Mongo 角色定義的唯一標識碼。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
請勿提示確認。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition exists
檢查 Azure Cosmos DB MongoDb 角色定義是否存在。
az cosmosdb mongodb role definition exists --account-name
--id
--resource-group
範例
檢查 Azure Cosmos DB MongoDb 角色定義是否存在。
az cosmosdb mongodb role definition exists --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39
必要參數
Cosmosdb 帳戶名稱。
Mongo 角色定義的唯一標識碼。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition exists (cosmosdb-preview 擴充功能)
檢查 Azure Cosmos DB MongoDb 角色定義是否存在。
az cosmosdb mongodb role definition exists --account-name
--id
--resource-group
範例
檢查 Azure Cosmos DB MongoDb 角色定義是否存在。
az cosmosdb mongodb role definition exists --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39
必要參數
Cosmosdb 帳戶名稱。
Mongo 角色定義的唯一標識碼。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition list
列出 Azure Cosmos DB 帳戶下的所有 MongoDb 角色定義。
az cosmosdb mongodb role definition list --account-name
--resource-group
範例
列出 Azure Cosmos DB 帳戶下的所有 Mongodb 角色定義。
az cosmosdb mongodb role definition list --account-name MyAccount --resource-group MyResourceGroup
必要參數
Cosmosdb 帳戶名稱。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition list (cosmosdb-preview 擴充功能)
列出 Azure Cosmos DB 帳戶下的所有 MongoDb 角色定義。
az cosmosdb mongodb role definition list --account-name
--resource-group
範例
列出 Azure Cosmos DB 帳戶下的所有 Mongodb 角色定義。
az cosmosdb mongodb role definition list --account-name MyAccount --resource-group MyResourceGroup
必要參數
Cosmosdb 帳戶名稱。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition show
顯示 Azure Cosmos DB 帳戶下 MongoDb 角色定義的屬性。
az cosmosdb mongodb role definition show --account-name
--id
--resource-group
範例
顯示 Azure Cosmos DB 帳戶下 MongoDb 角色定義的屬性。
az cosmosdb mongodb role definition show --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39
必要參數
Cosmosdb 帳戶名稱。
Mongo 角色定義的唯一標識碼。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition show (cosmosdb-preview 擴充功能)
顯示 Azure Cosmos DB 帳戶下 MongoDb 角色定義的屬性。
az cosmosdb mongodb role definition show --account-name
--id
--resource-group
範例
顯示 Azure Cosmos DB 帳戶下 MongoDb 角色定義的屬性。
az cosmosdb mongodb role definition show --account-name MyAccount --resource-group MyResourceGroup --id be79875a-2cc4-40d5-8958-566017875b39
必要參數
Cosmosdb 帳戶名稱。
Mongo 角色定義的唯一標識碼。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition update
更新 Azure Cosmos DB 帳戶下的 MongoDb 角色定義。
az cosmosdb mongodb role definition update --account-name
--body
--resource-group
範例
更新 Azure Cosmos DB 帳戶下的 MongoDb 角色定義。
az cosmosdb mongodb role definition update --account-name MyAccount --resource-group MyResourceGroup --body @mongo-role-definition.json
必要參數
Cosmosdb 帳戶名稱。
具有標識符的角色定義主體(選擇性用於建立)、類型(預設值為 CustomRole)、DatabaseName、Privileges、Roles。 您可以將它輸入為字串或檔案,例如 --body @mongo-role_definition-body-file.json 或 --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“}]}”。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az cosmosdb mongodb role definition update (cosmosdb-preview 擴充功能)
更新 Azure Cosmos DB 帳戶下的 MongoDb 角色定義。
az cosmosdb mongodb role definition update --account-name
--body
--resource-group
範例
更新 Azure Cosmos DB 帳戶下的 MongoDb 角色定義。
az cosmosdb mongodb role definition update --account-name MyAccount --resource-group MyResourceGroup --body @mongo-role-definition.json
必要參數
Cosmosdb 帳戶名稱。
具有標識符的角色定義主體(選擇性用於建立)、類型(預設值為 CustomRole)、DatabaseName、Privileges、Roles。 您可以將它輸入為字串或檔案,例如 --body @mongo-role_definition-body-file.json 或 --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“}] }”。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |