az cosmosdb sql container

注意

此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。

管理 Azure Cosmos DB SQL 容器。

命令

名稱 Description 類型 狀態
az cosmosdb sql container create

在 Azure Cosmos DB SQL 資料庫下建立 SQL 容器。

核心 GA
az cosmosdb sql container create (cosmosdb-preview 擴充功能)

在 Azure Cosmos DB SQL 資料庫下建立 SQL 容器。

副檔名 GA
az cosmosdb sql container delete

刪除 Azure Cosmos DB SQL 資料庫下的 SQL 容器。

核心 GA
az cosmosdb sql container exists

檢查 Azure Cosmos DB SQL 容器是否存在。

核心 GA
az cosmosdb sql container list

列出 Azure Cosmos DB SQL 資料庫底下的 SQL 容器。

核心 GA
az cosmosdb sql container merge

合併 sql 容器的數據分割。

副檔名 預覽​​
az cosmosdb sql container redistribute-partition-throughput

重新發佈 sql 容器的數據分割輸送量。

副檔名 預覽​​
az cosmosdb sql container restore

還原相同帳戶內已刪除的 SQL 容器。

核心 GA
az cosmosdb sql container restore (cosmosdb-preview 擴充功能)

還原相同帳戶內已刪除的 SQL 容器。

副檔名 預覽​​
az cosmosdb sql container retrieve-partition-throughput

擷取 sql 容器的數據分割輸送量。

副檔名 預覽​​
az cosmosdb sql container show

顯示 Azure Cosmos DB SQL 資料庫下 SQL 容器的詳細數據。

核心 GA
az cosmosdb sql container throughput

在 Azure Cosmos DB 帳戶下管理 SQL 容器的輸送量。

核心 GA
az cosmosdb sql container throughput migrate

在自動調整和手動布建之間移轉 SQL 容器的輸送量。

核心 GA
az cosmosdb sql container throughput show

取得 Azure Cosmos DB SQL 資料庫下 SQL 容器的輸送量。

核心 GA
az cosmosdb sql container throughput update

更新 Azure Cosmos DB SQL 資料庫下 SQL 容器的輸送量。

核心 GA
az cosmosdb sql container update

更新 Azure Cosmos DB SQL 資料庫下的 SQL 容器。

核心 GA
az cosmosdb sql container update (cosmosdb-preview 擴充功能)

更新 Azure Cosmos DB SQL 資料庫下的 SQL 容器。

副檔名 GA

az cosmosdb sql container create

在 Azure Cosmos DB SQL 資料庫下建立 SQL 容器。

az cosmosdb sql container create --account-name
                                 --database-name
                                 --name
                                 --partition-key-path
                                 --resource-group
                                 [--analytical-storage-ttl]
                                 [--cep]
                                 [--conflict-resolution-policy]
                                 [--idx]
                                 [--max-throughput]
                                 [--partition-key-version]
                                 [--throughput]
                                 [--ttl]
                                 [--unique-key-policy]

範例

建立 Azure Cosmos DB SQL 容器。

az cosmosdb sql container create -g MyResourceGroup -a MyAccount -d MyDatabase -n MyContainer --partition-key-path "/my/path" --idx @policy-file.json --ttl 1000 --throughput "700"

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--partition-key-path -p

分割區索引鍵路徑,例如 『/address/zipcode』。

--resource-group -g

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

選擇性參數

--analytical-storage-ttl -t

分析 TTL,啟用分析記憶體時。

--cep

用戶端加密原則,您可以將它輸入為字串或檔案,例如 --cep 或 --cep @policy-file.json “{”includedPaths“: [{”path“: ”/path1“,”clientEncryptionKeyId“: ”key1“,”encryptionAlgorithm“: ”AEAD_AES_256_CBC_HMAC_SHA256“,”encryptionType“: ”Deterministic“}],”policyFormatVersion“: 2}”。

--conflict-resolution-policy -c

衝突解決原則,您可以將它輸入為字串或檔案,例如 --conflict-resolution-policy 或 --conflict-resolution-policy @policy-file.json “{”mode“: ”lastWriterWins“, ”conflictResolutionPath“: ”/path“}”。

--idx

編製索引原則,您可以將它輸入為字串或檔案, 例如,-idx 或 --idx @policy-file.json “{”indexingMode“: ”consistent“, ”automatic“: true, ”includedPaths“: [{”path“: ”/*“}], ”excludedPaths“: [{ ”path“: ”/headquarters/employees/?“}, { ”path“: ”/\“_etag\”/?“}}”。

預設值: { "indexingMode": "consistent", "automatic": true, "includedPaths": [ { "path": "/*" } ], "excludedPaths": [ { "path": "/\"_etag\"/?" } ] }
--max-throughput

輸送量資源上限可以調整為 (RU/秒)。 提供資源啟用自動調整時。 最小值可以是 4000 (RU/秒)。

--partition-key-version

分割區索引鍵的版本。

--throughput

SQL 容器的輸送量(RU/秒)。 預設值為 400。 如果資料庫具有共用輸送量,除非容器應具有專用輸送量,否則請省略此參數。

--ttl

預設 TTL。 如果值遺失或設定為 「-1」,則專案不會過期。 如果值設定為 「n」 則專案會在上次修改時間之後的 「n」 秒到期。

--unique-key-policy -u

唯一索引鍵原則,您可以將它輸入為字串或檔案,例如 --unique-key-policy 或 --unique-key-policy @policy-file.json “{”uniqueKeys“: [{”paths“: [”/path/to/key1“]},{”paths“: [”/path/to/key2“]}}”。

全域參數
--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 container create (cosmosdb-preview 擴充功能)

在 Azure Cosmos DB SQL 資料庫下建立 SQL 容器。

az cosmosdb sql container create --account-name
                                 --database-name
                                 --name
                                 --partition-key-path
                                 --resource-group
                                 [--analytical-storage-ttl]
                                 [--cep]
                                 [--conflict-resolution-policy]
                                 [--idx]
                                 [--materialized-view-definition]
                                 [--max-throughput]
                                 [--partition-key-version]
                                 [--throughput]
                                 [--ttl]
                                 [--unique-key-policy]

範例

建立 Azure Cosmos DB SQL 容器。

az cosmosdb sql container create -g MyResourceGroup -a MyAccount -d MyDatabase -n MyContainer --partition-key-path "/my/path" --idx @policy-file.json --ttl 1000 --throughput "700"

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--partition-key-path -p

分割區索引鍵路徑,例如 『/address/zipcode』。

--resource-group -g

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

選擇性參數

--analytical-storage-ttl -t

分析 TTL,啟用分析記憶體時。

--cep

用戶端加密原則,您可以將它輸入為字串或檔案,例如 --cep 或 --cep @policy-file.json “{ ”includedPaths“: [{”path“: ”/path1“,”clientEncryptionKeyId“: ”key1“,”encryptionAlgorithm“: ”AEAD_AES_256_CBC_HMAC_SHA256“,”encryptionType“: ”Deterministic“}], ”policyFormatVersion“: 2}”。

--conflict-resolution-policy -c

衝突解決原則,您可以將它輸入為字串或檔案,例如 --conflict-resolution-policy 或 --conflict-resolution-policy @policy-file.json “{ ”mode“: ”lastWriterWins“, ”conflictResolutionPath“: ”/path“ }”。

--idx

編製索引原則,您可以將它輸入為字串或檔案, 例如,-idx 或 --idx @policy-file.json “{ ”indexingMode“: ”consistent“, ”automatic“: true, ”includedPaths“: [{”path“: ”/*“}], ”excludedPaths“: [{ ”path“: ”/headquarters/employees/?“}, { ”path“: ”/\“_etag\”/?“}] }”。

預設值: { "indexingMode": "consistent", "automatic": true, "includedPaths": [ { "path": "/*" } ], "excludedPaths": [ { "path": "/\"_etag\"/?" } ] }
--materialized-view-definition -m

具體化檢視定義,您可以將它輸入為字串或檔案,例如 --materialized-view-definition @materializedview-definition-file.json 或 --materialized-view-definition -m '{ “sourceCollectionId”: “MySourceCollectionName”, “definition”: “SELECT * FROM root r”}'。

--max-throughput

輸送量資源上限可以調整為 (RU/秒)。 提供資源啟用自動調整時。 最小值可以是 4000 (RU/秒)。

--partition-key-version

分割區索引鍵的版本。

--throughput

SQL 容器的輸送量(RU/秒)。 預設值為 400。 如果資料庫具有共用輸送量,除非容器應具有專用輸送量,否則請省略此參數。

--ttl

預設 TTL。 如果值遺失或設定為 「-1」,則專案不會過期。 如果值設定為 「n」 則專案會在上次修改時間之後的 「n」 秒到期。

--unique-key-policy -u

唯一索引鍵原則,您可以將它輸入為字串或檔案,例如 --unique-key-policy 或 --unique-key-policy @policy-file.json “{ ”uniqueKeys“: [{”paths“: [”/path/to/key1“]}, {”paths“: [”/path/to/key2“]}] }”。

全域參數
--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 container delete

刪除 Azure Cosmos DB SQL 資料庫下的 SQL 容器。

az cosmosdb sql container delete --account-name
                                 --database-name
                                 --name
                                 --resource-group
                                 [--yes]

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--resource-group -g

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

選擇性參數

--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 container exists

檢查 Azure Cosmos DB SQL 容器是否存在。

az cosmosdb sql container exists --account-name
                                 --database-name
                                 --name
                                 --resource-group

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--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 container list

列出 Azure Cosmos DB SQL 資料庫底下的 SQL 容器。

az cosmosdb sql container list --account-name
                               --database-name
                               --resource-group

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--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 container merge

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

合併 sql 容器的數據分割。

az cosmosdb sql container merge --account-name
                                --database-name
                                --name
                                --resource-group

範例

容器 my-container 的合併分割區

az cosmosdb sql container merge -g my-resource-group -a my-account -d my-db --name my-container

必要參數

--account-name -a

CosmosDB 資料庫帳戶的名稱。

--database-name -d

CosmosDB 資料庫名稱的名稱。

--name -n

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 container redistribute-partition-throughput

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

重新發佈 sql 容器的數據分割輸送量。

az cosmosdb sql container redistribute-partition-throughput --account-name
                                                            --database-name
                                                            --name
                                                            --resource-group
                                                            [--evenly-distribute {false, true}]
                                                            [--source-partition-info]
                                                            [--target-partition-info]

範例

將 sql 容器的數據分割輸送量平均分散到所有實體分割區之間

az cosmosdb sql container redistribute-partition-throughput --account-name account_name --database-name db_name --name container_name  --resource-group rg_name --evenly-distribute

將 sql 容器的數據分割輸送量從來源數據分割重新散發至目標數據分割

az cosmosdb sql container redistribute-partition-throughput --account-name account_name --database-name db_name --name container_name  --resource-group rg_name --target-partition-info 8=1200 6=1200]' --source-partition-info 9]'

必要參數

--account-name -a

CosmosDB 資料庫帳戶的名稱。

--database-name -d

CosmosDB 資料庫名稱的名稱。

--name -n

CosmosDB 集合的名稱。

--resource-group -g

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

選擇性參數

--evenly-distribute

切換為在所有實體分割區之間平均分散輸送量。

接受的值: false, true
預設值: False
--source-partition-info

空間分隔的來源實體分割區標識碼,例如:1 2。

預設值: []
--target-partition-info

所需目標實體分割區輸送量的相關信息,例如:0=1200 1=1200。

預設值: []
全域參數
--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 container restore

還原相同帳戶內已刪除的 SQL 容器。

az cosmosdb sql container restore --account-name
                                  --database-name
                                  --name
                                  --resource-group
                                  [--restore-timestamp]

範例

還原相同帳戶內已刪除的 SQL 容器。

az cosmosdb sql container restore --resource-group resource_group --account-name database_account_name --database-name parent_database_name --name name_of_container_needs_to_be_restored --restore-timestamp 2020-07-13T16:03:41+0000

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--resource-group -g

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

選擇性參數

--restore-timestamp -t

容器必須還原至的時間戳。

全域參數
--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 container restore (cosmosdb-preview 擴充功能)

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

還原相同帳戶內已刪除的 SQL 容器。

az cosmosdb sql container restore --account-name
                                  --database-name
                                  --name
                                  --resource-group
                                  [--disable-ttl {false, true}]
                                  [--restore-timestamp]

範例

還原相同帳戶內已刪除的 SQL 容器。

az cosmosdb sql container restore --resource-group resource_group --account-name database_account_name --database-name parent_database_name --name name_of_container_needs_to_be_restored --restore-timestamp 2020-07-13T16:03:41+0000

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--resource-group -g

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

選擇性參數

--disable-ttl
預覽

啟用或停用已停用ttl還原。

接受的值: false, true
--restore-timestamp -t

容器必須還原至的時間戳。

全域參數
--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 container retrieve-partition-throughput

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

擷取 sql 容器的數據分割輸送量。

az cosmosdb sql container retrieve-partition-throughput --account-name
                                                        --database-name
                                                        --name
                                                        --resource-group
                                                        [--all-partitions {false, true}]
                                                        [--physical-partition-ids]

範例

擷取特定實體分割區的容器container_name輸送量

az cosmosdb sql container retrieve-partition-throughput --account-name account_name --database-name db_name --name container_name  --resource-group rg_name --physical-partition-ids 8 9

擷取所有實體分割區的容器container_name輸送量

az cosmosdb sql container retrieve-partition-throughput --account-name account_name --database-name db_name --name container_name  --resource-group rg_name --all-partitions

必要參數

--account-name -a

CosmosDB 資料庫帳戶的名稱。

--database-name -d

CosmosDB 資料庫名稱的名稱。

--name -n

CosmosDB 容器的名稱。

--resource-group -g

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

選擇性參數

--all-partitions

切換以擷取所有實體分割區的輸送量。

接受的值: false, true
預設值: False
--physical-partition-ids -p

實體分割區標識子的空間分隔清單。

預設值: []
全域參數
--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 container show

顯示 Azure Cosmos DB SQL 資料庫下 SQL 容器的詳細數據。

az cosmosdb sql container show --account-name
                               --database-name
                               --name
                               --resource-group

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--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 container update

更新 Azure Cosmos DB SQL 資料庫下的 SQL 容器。

az cosmosdb sql container update --account-name
                                 --database-name
                                 --name
                                 --resource-group
                                 [--analytical-storage-ttl]
                                 [--idx]
                                 [--ttl]

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--resource-group -g

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

選擇性參數

--analytical-storage-ttl -t

分析 TTL,啟用分析記憶體時。

--idx

編製索引原則,您可以將它輸入為字串或檔案, 例如,-idx 或 --idx @policy-file.json “{”indexingMode“: ”consistent“, ”automatic“: true, ”includedPaths“: [{”path“: ”/*“}], ”excludedPaths“: [{ ”path“: ”/headquarters/employees/?“}, { ”path“: ”/\“_etag\”/?“}}”。

--ttl

預設 TTL。 如果值遺失或設定為 「-1」,則專案不會過期。 如果值設定為 「n」 則專案會在上次修改時間之後的 「n」 秒到期。

全域參數
--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 container update (cosmosdb-preview 擴充功能)

更新 Azure Cosmos DB SQL 資料庫下的 SQL 容器。

az cosmosdb sql container update --account-name
                                 --database-name
                                 --name
                                 --resource-group
                                 [--analytical-storage-ttl]
                                 [--idx]
                                 [--materialized-view-definition]
                                 [--ttl]

必要參數

--account-name -a

Cosmosdb 帳戶名稱。

--database-name -d

資料庫名稱。

--name -n

容器名稱。

--resource-group -g

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

選擇性參數

--analytical-storage-ttl -t

分析 TTL,啟用分析記憶體時。

--idx

編製索引原則,您可以將它輸入為字串或檔案, 例如,-idx 或 --idx @policy-file.json “{ ”indexingMode“: ”consistent“, ”automatic“: true, ”includedPaths“: [{”path“: ”/*“}], ”excludedPaths“: [{ ”path“: ”/headquarters/employees/?“}, { ”path“: ”/\“_etag\”/?“}] }”。

--materialized-view-definition -m

具體化檢視定義,您可以將它輸入為字串或檔案,例如 --materialized-view-definition @materializedview-definition-file.json 或 --materialized-view-definition -m '{ “sourceCollectionId”: “MySourceCollectionName”, “definition”: “SELECT * FROM root r”}'。

--ttl

預設 TTL。 如果值遺失或設定為 「-1」,則專案不會過期。 如果值設定為 「n」 則專案會在上次修改時間之後的 「n」 秒到期。

全域參數
--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 來取得完整偵錯記錄。