Share via


Azure Cosmos DB for Table 的 Azure PowerShell 範例

適用於: Table

下表包含適用於 Azure Cosmos DB 的常用 Azure PowerShell 指令碼連結。 使用右側的連結瀏覽至 API 特定範例。 所有 API 的通用範例皆相同。 您可以在 Azure PowerShell 參考中取得所有 Azure Cosmos DB PowerShell Cmdlet 的參考頁面。 Az.CosmosDB 模組現在是 Az 模組的一部分。 下載並安裝最新版的 Az 模組,以取得 Azure Cosmos DB Cmdlet。 您也可以從 PowerShell 資源庫取得最新版本。 您也可以從 GitHub 存放庫 (GitHub 上的 Azure Cosmos DB PowerShell 範例) 的 Azure Cosmos DB 派生這些 PowerShell 範例。

通用範例

Task 描述
更新帳戶 更新 Azure Cosmos DB 帳戶的預設一致性層級。
更新帳戶的區域 更新 Azure Cosmos DB 帳戶的區域。
變更容錯移轉優先順序或觸發容錯移轉 變更 Azure Cosmos DB 帳戶的地區性容錯移轉優先順序或觸發手動容錯移轉。
帳戶金鑰或連接字串 取得主要和次要金鑰、連接字串,或重新產生 Azure Cosmos DB 帳戶的帳戶金鑰。
建立具有 IP 防火牆的 Azure Cosmos DB 帳戶 建立已啟用 IP 防火牆的 Azure Cosmos DB 帳戶。

API for Table 範例

Task 描述
建立帳戶和資料表 建立 Azure Cosmos DB 帳戶與資料表。
建立具有自動調整功能的帳戶和資料表 建立 Azure Cosmos DB 帳戶和資料表自動調整。
列出或取得資料表 列出或取得資料表
執行輸送量作業 執行資料表的輸送量作業,包括自動調整和標準輸送量之間的取得、更新和遷移。
鎖定資源避免刪除 使用資源鎖定避免刪除資源。