适用于 Azure Cosmos DB 的 Azure PowerShell 示例 - SQL (Core) APIAzure PowerShell samples for Azure Cosmos DB - SQL (Core) API

下表包含常用于 Azure Cosmos DB for SQL (Core) API 的 Azure PowerShell 脚本的链接。The following table includes links to commonly used Azure PowerShell scripts for Azure Cosmos DB for SQL (Core) API. 若要从我们的 GitHub 存储库创建这些适用于 Cosmos DB 的 PowerShell 示例的分支,请访问 GitHub 上的 Cosmos DB PowerShell 示例If you'd like to fork these PowerShell samples for Cosmos DB from our GitHub repository, visit Cosmos DB PowerShell Samples on GitHub.

有关 SQL (Core) API 的其他 Cosmos DB PowerShell 示例和文档,请参阅使用 PowerShell 管理 Azure Cosmos DB SQL API 资源For additional Cosmos DB PowerShell samples for SQL (Core) API and documentation, see Manage Azure Cosmos DB SQL API resources using PowerShell. 有关其他 API 的 Cosmos DB PowerShell 示例,请参阅 Cassandra APIMongoDB APIGremlin API表 APIFor Cosmos DB PowerShell samples for other APIs, see Cassandra API, MongoDB API, Gremlin API, and Table API.

备注

该示例使用 Az.CosmosDB 管理 cmdlet。The samples use Az.CosmosDB management cmdlets. 请定期检查 Az.CosmosDB 是否有更新。Please check for updates to Az.CosmosDB regularly.

任务Task 说明Description
创建帐户、数据库和容器Create an account, database and container 创建 Azure Cosmos DB 帐户、数据库和容器。Create an Azure Cosmos DB account, database and container.
创建具有大分区键的容器Create a container with a large partition key 创建具有大分区键的容器。Create a container with a large partition key.
列出或获取数据库或容器List or get databases or containers 列出或获取数据库或容器。List or get database or containers.
获取 RU/秒Get RU/s 获取数据库或容器的 RU/秒。Get RU/s for a database or container.
更新 RU/秒Update RU/s 更新数据库或容器的 RU/秒。Update RU/s for a database or container.
使用无索引策略创建容器Create a container with no index policy 在索引策略关闭的情况下创建 Azure Cosmos 容器。Create an Azure Cosmos container with index policy turned off.
更新帐户Update an account 更新 Cosmos DB 帐户的默认一致性级别。Update a Cosmos DB account's default consistency level.
更新帐户的区域Update an account's regions 更新 Cosmos DB 帐户的区域。Update a Cosmos DB account's regions.
更改故障转移优先级或触发故障转移Change failover priority or trigger failover 更改 Azure Cosmos 帐户的区域故障转移优先级或触发手动故障转移。Change the regional failover priority of an Azure Cosmos account or trigger a manual failover.
帐户密钥或连接字符串Account keys or connection strings 获取 Azure Cosmos DB 帐户的主密钥和辅助密钥、连接字符串或重新生成其帐户密钥。Get primary and secondary keys, connection strings or regenerate an account key of an Azure Cosmos DB account.
创建启用 IP 防火墙的 Cosmos 帐户Create a Cosmos Account with IP Firewall 创建启用 IP 防火墙的 Azure Cosmos DB 帐户。Create an Azure Cosmos DB account with IP Firewall enabled.