title | description | author | ms.author | ms.reviewer | ms.service | ms.subservice | ms.topic | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|
Azure Cosmos DB for Apache Cassandra keyspace and table with autoscale |
Use Azure CLI to create an Azure Cosmos DB for Apache Cassandra account, keyspace, and table with autoscale. |
seesharprun |
sidandrews |
mjbrown |
cosmos-db |
apache-cassandra |
sample |
05/02/2022 |
kr2b-contr-experiment, devx-track-azurecli |
[!INCLUDECassandra]
The script in this article creates an Azure Cosmos DB for Apache Cassandra account, keyspace, and table with autoscale.
-
[!INCLUDE quickstarts-free-trial-note]
-
This script requires Azure CLI version 2.12.1 or later.
-
You can run the script in the Bash environment in Azure Cloud Shell. When Cloud Shell opens, make sure to select Bash in the environment field at the upper left of the shell window. Cloud Shell has the latest version of Azure CLI.
:::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
-
If you prefer, you can install Azure CLI to run the script locally. Run az version to find your Azure CLI version, and run az upgrade if you need to upgrade. Sign in to Azure by running az login.
-
This script uses the following commands:
- az group create creates a resource group to store all resources.
- az cosmosdb create with the
--capabilities EnableCassandra
parameter creates a API for Cassandra-enabled Azure Cosmos DB account. - az cosmosdb cassandra keyspace create creates an Azure Cosmos DB Cassandra keyspace.
- az cosmosdb cassandra table create with the
--max-throughput
parameter set to minimum4000
creates an Azure Cosmos DB Cassandra table with autoscale.
:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/cassandra/autoscale.sh" id="FullScript":::
If you don't need the resources you created, use the az group delete command to delete the resource group and all resources it contains, including the Azure Cosmos DB account and keyspace.
az group delete --name $resourceGroup