az cosmosdb sql role assignment

管理 Azure Cosmos DB SQL 角色指派。

命令

名稱 Description 類型 狀態
az cosmosdb sql role assignment create

在 Azure Cosmos DB 帳戶下建立 SQL 角色指派。

核心 GA
az cosmosdb sql role assignment delete

刪除 Azure Cosmos DB 帳戶下的 SQL 角色指派。

核心 GA
az cosmosdb sql role assignment exists

檢查 Azure Cosmos DB 角色指派是否存在。

核心 GA
az cosmosdb sql role assignment list

列出 Azure Cosmos DB 帳戶下的所有 SQL 角色指派。

核心 GA
az cosmosdb sql role assignment show

顯示 Azure Cosmos DB 帳戶下 SQL 角色指派的屬性。

核心 GA
az cosmosdb sql role assignment update

更新 Azure Cosmos DB 帳戶下的 SQL 角色指派。

核心 GA
az cosmosdb sql role assignment wait

輪詢 SQL 角色指派,直到符合特定條件為止。

核心 GA

az cosmosdb sql role assignment create

在 Azure Cosmos DB 帳戶下建立 SQL 角色指派。

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

範例

使用角色定義名稱,在 Azure Cosmos DB 帳戶下建立 SQL 角色指派。

az cosmosdb sql 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

使用角色定義識別碼,在 Azure Cosmos DB 帳戶下建立 SQL 角色指派。

az cosmosdb sql 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

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--principal-id -p

要授與此角色指派之主體的 AAD 物件識別碼。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--scope -s

要授與此角色指派的資料平面資源路徑。

選擇性參數

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--role-assignment-id -i

選擇性的 [建立]。 角色指派的唯一識別碼。 如果未提供,則會使用新的 GUID。

--role-definition-id -d

此角色指派所參考之角色定義的唯一識別碼。

--role-definition-name -n

此角色指派所參考之角色定義的唯一名稱。 例如: 'Contoso 讀者角色'。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az cosmosdb sql role assignment delete

刪除 Azure Cosmos DB 帳戶下的 SQL 角色指派。

az cosmosdb sql role assignment delete --account-name
                                       --resource-group
                                       --role-assignment-id
                                       [--no-wait]
                                       [--yes]

範例

刪除 Azure Cosmos DB 帳戶下的 SQL 角色指派。

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

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--role-assignment-id -i

選擇性的 [建立]。 角色指派的唯一識別碼。 如果未提供,則會使用新的 GUID。

選擇性參數

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az cosmosdb sql role assignment exists

檢查 Azure Cosmos DB 角色指派是否存在。

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

範例

檢查 Azure Cosmos DB 角色指派是否存在。

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

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--role-assignment-id -i

選擇性的 [建立]。 角色指派的唯一識別碼。 如果未提供,則會使用新的 GUID。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az cosmosdb sql role assignment list

列出 Azure Cosmos DB 帳戶下的所有 SQL 角色指派。

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

範例

列出 Azure Cosmos DB 帳戶下的所有 SQL 角色指派。

az cosmosdb sql role assignment list --account-name MyAccount --resource-group MyResourceGroup

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az cosmosdb sql role assignment show

顯示 Azure Cosmos DB 帳戶下 SQL 角色指派的屬性。

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

範例

顯示 Azure Cosmos DB 帳戶下 SQL 角色指派的屬性。

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

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--role-assignment-id -i

選擇性的 [建立]。 角色指派的唯一識別碼。 如果未提供,則會使用新的 GUID。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az cosmosdb sql role assignment update

更新 Azure Cosmos DB 帳戶下的 SQL 角色指派。

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

範例

更新 Azure Cosmos DB 帳戶下的 SQL 角色指派。

az cosmosdb sql role assignment update --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-id updated-role-definition-id

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--role-assignment-id -i

選擇性的 [建立]。 角色指派的唯一識別碼。 如果未提供,則會使用新的 GUID。

選擇性參數

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--principal-id -p

要授與此角色指派之主體的 AAD 物件識別碼。

--role-definition-id -d

此角色指派所參考之角色定義的唯一識別碼。

--role-definition-name -n

此角色指派所參考之角色定義的唯一名稱。 例如: 'Contoso 讀者角色'。

--scope -s

要授與此角色指派的資料平面資源路徑。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az cosmosdb sql role assignment wait

輪詢 SQL 角色指派,直到符合特定條件為止。

az cosmosdb sql role assignment wait --account-name
                                     --resource-group
                                     --role-assignment-id
                                     [--created]
                                     [--custom]
                                     [--deleted]
                                     [--exists]
                                     [--interval]
                                     [--timeout]
                                     [--updated]

範例

輪詢 SQL 角色指派,直到刪除為止。

az cosmosdb sql role assignment wait --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 --deleted

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--role-assignment-id -i

選擇性的 [建立]。 角色指派的唯一識別碼。 如果未提供,則會使用新的 GUID。

選擇性參數

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

預設值: False
--custom

等到條件符合自訂 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--interval

輪詢間隔以秒為單位。

預設值: 30
--timeout

以秒為單位的等候上限。

預設值: 3600
--updated

等到 provisioningState 更新為 'Succeeded'。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。