Azure CLI samples for Azure Cosmos DB Cassandra API
APPLIES TO:
Cassandra API
The following table includes links to sample Azure CLI scripts for Azure Cosmos DB. Use the links on the right to navigate to API specific samples. Common samples are the same across all APIs. Reference pages for all Azure Cosmos DB CLI commands are available in the Azure CLI Reference. Azure Cosmos DB CLI script samples can also be found in the Azure Cosmos DB CLI GitHub Repository.
These samples require Azure CLI version 2.12.1 or later. Run az --version to find the version. If you need to install or upgrade, see Install Azure CLI
Common Samples
These samples apply to all Azure Cosmos DB APIs
| Task | Description |
|---|---|
| Add or failover regions | Add a region, change failover priority, trigger a manual failover. |
| Account keys and connection strings | List account keys, read-only keys, regenerate keys and list connection strings. |
| Secure with IP firewall | Create a Cosmos account with IP firewall configured. |
| Secure new account with service endpoints | Create a Cosmos account and secure with service-endpoints. |
| Secure existing account with service endpoints | Update a Cosmos account to secure with service-endpoints when the subnet is eventually configured. |
Cassandra API Samples
| Task | Description |
|---|---|
| Create an Azure Cosmos account, keyspace and table | Creates an Azure Cosmos DB account, keyspace, and table for Cassandra API. |
| Create a serverless Azure Cosmos account for Cassandra API, keyspace and table | Creates a serverless Azure Cosmos DB account, keyspace, and table for Cassandra API. |
| Create an Azure Cosmos account, keyspace and table with autoscale | Creates an Azure Cosmos DB account, keyspace, and table with autoscale for Cassandra API. |
| Throughput operations | Read, update and migrate between autoscale and standard throughput on a keyspace and table. |
| Lock resources from deletion | Prevent resources from being deleted with resource locks. |