Azure PowerShell samples for Azure Cosmos DB

The following table includes links to sample Azure PowerShell scripts for Azure Cosmos DB for Core (SQL) API.

Azure Cosmos accounts
Create an account Creates an Azure Cosmos SQL API account.
Get an account Get the properties of an Azure Cosmos account.
Add a region Get an Azure Cosmos account and add a region to the list of locations.
Change the failover priority Change the failover priority of an Azure Cosmos account with a manual failover trigger.
Update tags Update the tags for an Azure Cosmos account.
Get account keys Get the primary and secondary keys of an Azure Cosmos account.
Regenerate account keys Regenerate the primary and secondary keys of an Azure Cosmos account.
List connection strings Get the primary and secondary connection strings of an Azure Cosmos account.
Create IP Firewall Create an IP Firewall for an Azure Cosmos account.
Delete an Azure Cosmos account Delete an Azure Cosmos account.
Azure Cosmos databases
Create a database Create a database within an Azure Cosmos account.
Create a database with shared/database-level throughput Create an Azure Cosmos database with database-level throughput that is shared with its containers.
List all databases List all the databases in an Azure Cosmos account.
Get a database Get the properties of an Azure Cosmos database.
Azure Cosmos containers
Create a container Create an Azure Cosmos container with dedicated throughput.
Create a container with shared throughput Create an Azure Cosmos container with throughput shared with other containers in the database.
Create a container with index policy Create an Azure Cosmos container with a custom index policy.
Create a container with no index policy Create an Azure Cosmos container with index policy turned off.
Create a container with unique keys & TTL Create an Azure Cosmos container with a unique key constraint and time-to-live configured.
Create a container with conflict resolution Create an Azure Cosmos container with last-writer-wins conflict resolution policy.
List all containers List all containers in an Azure Cosmos database.
Get a container Get the properties for a container in an Azure Cosmos database.
Delete a container Delete a container in an Azure Cosmos database.