Skip to content

Commit cc1f2a3

Browse files
authored
Merge pull request #196679 from v-thepet/cosmosdb2
DevEdit Cosmos DB cli samples
2 parents 56fe525 + 753a136 commit cc1f2a3

File tree

4 files changed

+73
-79
lines changed

4 files changed

+73
-79
lines changed
Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
---
2-
title: Create a Cassandra keyspace and table with autoscale for Azure Cosmos DB
3-
description: Create a Cassandra keyspace and table with autoscale for Azure Cosmos DB
2+
title: Azure Cosmos DB Cassandra API keyspace and table with autoscale
3+
description: Use Azure CLI to create an Azure Cosmos DB Cassandra API account, keyspace, and table with autoscale.
44
author: markjbrown
55
ms.author: mjbrown
66
ms.service: cosmos-db
77
ms.subservice: cosmosdb-cassandra
88
ms.topic: sample
9-
ms.date: 02/21/2022
9+
ms.date: 05/02/2022
10+
ms.custom: kr2b-contr-experiment
1011
---
1112

12-
# Create an Azure Cosmos Cassandra API account, keyspace and table with autoscale using Azure CLI
13+
# Use Azure CLI to create a Cassandra API account, keyspace, and table with autoscale
1314

1415
[!INCLUDE [appliesto-cassandra-api](../../../includes/appliesto-cassandra-api.md)]
1516

16-
The script in this article demonstrates creating an Azure Cosmos DB account, keyspace, and table with autoscale for the Cassandra API.
17+
The script in this article creates an Azure Cosmos DB Cassandra API account, keyspace, and table with autoscale.
1718

18-
[!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
19+
## Prerequisites
1920

20-
[!INCLUDE [azure-cli-prepare-your-environment.md](../../../../../includes/azure-cli-prepare-your-environment.md)]
21+
- [!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
2122

22-
- This article requires 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](/cli/azure/install-azure-cli). If using Azure Cloud Shell, the latest version is already installed.
23+
- This script requires Azure CLI version 2.12.1 or later.
24+
25+
- You can run the script in the Bash environment in [Azure Cloud Shell](/azure/cloud-shell/quickstart). 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.
26+
27+
[![Launch Cloud Shell in a new window](../../../../../includes/media/cloud-shell-try-it/hdi-launch-cloud-shell.png)](https://shell.azure.com)
28+
29+
- If you prefer, you can [install Azure CLI](/cli/azure/install-azure-cli) to run the script locally. Run [az version](/cli/azure/reference-index?#az-version) to find your Azure CLI version, and run [az upgrade](/cli/azure/reference-index?#az-upgrade) if you need to upgrade. Sign in to Azure by running [az login](/cli/azure/reference-index#az-login).
2330

2431
## Sample script
2532

26-
[!INCLUDE [cli-launch-cloud-shell-sign-in.md](../../../../../includes/cli-launch-cloud-shell-sign-in.md)]
33+
This script uses the following commands:
2734

28-
### Run the script
35+
- [az group create](/cli/azure/group#az-group-create) creates a resource group to store all resources.
36+
- [az cosmosdb create](/cli/azure/cosmosdb#az-cosmosdb-create) with the `--capabilities EnableCassandra` parameter creates a Cassandra API-enabled Azure Cosmos DB account.
37+
- [az cosmosdb cassandra keyspace create](/cli/azure/cosmosdb/cassandra/keyspace#az-cosmosdb-cassandra-keyspace-create) creates an Azure Cosmos DB Cassandra keyspace.
38+
- [az cosmosdb cassandra table create](/cli/azure/cosmosdb/cassandra/table#az-cosmosdb-cassandra-table-create) with the `--max-throughput` parameter set to minimum `4000` creates an Azure Cosmos DB Cassandra table with autoscale.
2939

3040
:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/cassandra/autoscale.sh" id="FullScript":::
3141

32-
## Clean up resources
42+
## Delete resources
3343

34-
[!INCLUDE [cli-clean-up-resources.md](../../../../../includes/cli-clean-up-resources.md)]
44+
If you don't need the resources you created, use the [az group delete](/cli/azure/group#az-group-delete) command to delete the resource group and all resources it contains, including the Azure Cosmos DB account and keyspace.
3545

3646
```azurecli
3747
az group delete --name $resourceGroup
3848
```
3949

40-
## Sample reference
41-
42-
This script uses the following commands. Each command in the table links to command specific documentation.
43-
44-
| Command | Notes |
45-
|---|---|
46-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
47-
| [az cosmosdb create](/cli/azure/cosmosdb#az-cosmosdb-create) | Creates an Azure Cosmos DB account. |
48-
| [az cosmosdb cassandra keyspace create](/cli/azure/cosmosdb/cassandra/keyspace#az-cosmosdb-cassandra-keyspace-create) | Creates an Azure Cosmos Cassandra keyspace. |
49-
| [az cosmosdb cassandra table create](/cli/azure/cosmosdb/cassandra/table#az-cosmosdb-cassandra-table-create) | Creates an Azure Cosmos Cassandra table. |
50-
| [az group delete](/cli/azure/resource#az-resource-delete) | Deletes a resource group including all nested resources. |
51-
5250
## Next steps
5351

54-
For more information on the Azure Cosmos DB CLI, see [Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb).
52+
[Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb)
Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
---
2-
title: Create a Gremlin database and graph with autoscale for Azure Cosmos DB
3-
description: Create a Gremlin database and graph with autoscale for Azure Cosmos DB
2+
title: Azure Cosmos DB Gremlin database and graph with autoscale
3+
description: Use this Azure CLI script to create an Azure Cosmos DB Gremlin API account, database, and graph with autoscale.
44
author: markjbrown
55
ms.author: mjbrown
66
ms.service: cosmos-db
77
ms.subservice: cosmosdb-graph
88
ms.topic: sample
9-
ms.date: 02/21/2022
9+
ms.date: 05/02/2022
10+
ms.custom: kr2b-contr-experiment
1011
---
1112

12-
# Create an Azure Cosmos Gremlin API account, database and graph with autoscale using Azure CLI
13+
# Use Azure CLI to create a Gremlin API account, database, and graph with autoscale
1314

14-
[!INCLUDE[appliesto-gremlin-api](../../../includes/appliesto-gremlin-api.md)]
15+
[!INCLUDE [appliesto-gremlin-api](../../../includes/appliesto-gremlin-api.md)]
1516

16-
The script in this article demonstrates creating a Gremlin API database and graph with autoscale.
17+
The script in this article creates an Azure Cosmos DB Gremlin API account, database, and graph with autoscale.
1718

18-
[!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
19+
## Prerequisites
1920

20-
[!INCLUDE [azure-cli-prepare-your-environment.md](../../../../../includes/azure-cli-prepare-your-environment.md)]
21+
- [!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
2122

22-
- This article requires version 2.30 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli). If using Azure Cloud Shell, the latest version is already installed.
23+
- This script requires Azure CLI version 2.30 or later.
24+
25+
- You can run the script in the Bash environment in [Azure Cloud Shell](/azure/cloud-shell/quickstart). 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.
26+
27+
[![Launch Cloud Shell in a new window](../../../../../includes/media/cloud-shell-try-it/hdi-launch-cloud-shell.png)](https://shell.azure.com)
28+
29+
- If you prefer, you can [install Azure CLI](/cli/azure/install-azure-cli) to run the script locally. Run [az version](/cli/azure/reference-index?#az-version) to find your Azure CLI version, and run [az upgrade](/cli/azure/reference-index?#az-upgrade) if you need to upgrade. Sign in to Azure by running [az login](/cli/azure/reference-index#az-login).
2330

2431
## Sample script
2532

26-
[!INCLUDE [cli-launch-cloud-shell-sign-in.md](../../../../../includes/cli-launch-cloud-shell-sign-in.md)]
33+
This script uses the following commands:
2734

28-
### Run the script
35+
- [az group create](/cli/azure/group#az-group-create) creates a resource group to store all resources.
36+
- [az cosmosdb create](/cli/azure/cosmosdb#az-cosmosdb-create) with the `--capabilities EnableGremlin` parameter creates a Gremlin-enabled Azure Cosmos DB account.
37+
- [az cosmosdb gremlin database create](/cli/azure/cosmosdb/gremlin/database#az-cosmosdb-gremlin-database-create) creates an Azure Cosmos DB Gremlin database.
38+
- [az cosmosdb gremlin graph create](/cli/azure/cosmosdb/gremlin/graph#az-cosmosdb-gremlin-graph-create) with the `--max-throughput` parameter set to minimum `4000` creates an Azure Cosmos DB Gremlin graph with autoscale.
2939

3040
:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/gremlin/autoscale.sh" id="FullScript":::
3141

32-
## Clean up resources
42+
## Delete resources
3343

34-
[!INCLUDE [cli-clean-up-resources.md](../../../../../includes/cli-clean-up-resources.md)]
44+
If you don't need the resources the script created, use the [az group delete](/cli/azure/group#az-group-delete) command to delete the resource group and all resources it contains, including the Azure Cosmos DB account and database.
3545

3646
```azurecli
3747
az group delete --name $resourceGroup
3848
```
3949

40-
## Sample reference
41-
42-
This script uses the following commands. Each command in the table links to command specific documentation.
43-
44-
| Command | Notes |
45-
|---|---|
46-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
47-
| [az cosmosdb create](/cli/azure/cosmosdb#az-cosmosdb-create) | Creates an Azure Cosmos DB account. |
48-
| [az cosmosdb gremlin database create](/cli/azure/cosmosdb/gremlin/database#az-cosmosdb-gremlin-database-create) | Creates an Azure Cosmos Gremlin database. |
49-
| [az cosmosdb gremlin graph create](/cli/azure/cosmosdb/gremlin/graph#az-cosmosdb-gremlin-graph-create) | Creates an Azure Cosmos Gremlin graph. |
50-
| [az group delete](/cli/azure/resource#az-resource-delete) | Deletes a resource group including all nested resources. |
51-
5250
## Next steps
5351

54-
For more information on the Azure Cosmos DB CLI, see [Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb).
52+
[Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb)
Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
---
2-
title: Create a Gremlin serverless account, database and graph for Azure Cosmos DB
3-
description: Create a Gremlin serverless account, database and graph for Azure Cosmos DB
2+
title: Azure Cosmos DB Gremlin serverless account, database, and graph
3+
description: Use this Azure CLI script to create an Azure Cosmos DB Gremlin serverless account, database, and graph.
44
author: markjbrown
55
ms.author: mjbrown
66
ms.service: cosmos-db
77
ms.subservice: cosmosdb-graph
88
ms.topic: sample
9-
ms.date: 02/21/2022
9+
ms.date: 05/02/2022
10+
ms.custom: kr2b-contr-experiment
1011
---
1112

12-
# Create an Azure Cosmos Gremlin API serverless account, database and graph using Azure CLI
13+
# Use Azure CLI to create a Gremlin serverless account, database, and graph
1314

14-
[!INCLUDE[appliesto-gremlin-api](../../../includes/appliesto-gremlin-api.md)]
15+
[!INCLUDE [appliesto-gremlin-api](../../../includes/appliesto-gremlin-api.md)]
1516

16-
The script in this article demonstrates creating a Gremlin serverless account, database and graph.
17+
The script in this article creates an Azure Cosmos DB Gremlin API serverless account, database, and graph.
1718

18-
[!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
19+
## Prerequisites
1920

20-
[!INCLUDE [azure-cli-prepare-your-environment.md](../../../../../includes/azure-cli-prepare-your-environment.md)]
21+
- [!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
2122

22-
- This article requires version 2.30 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli). If using Azure Cloud Shell, the latest version is already installed.
23+
- This script requires Azure CLI version 2.30 or later.
24+
25+
- You can run the script in the Bash environment in [Azure Cloud Shell](/azure/cloud-shell/quickstart). 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.
26+
27+
[![Launch Cloud Shell in a new window](../../../../../includes/media/cloud-shell-try-it/hdi-launch-cloud-shell.png)](https://shell.azure.com)
28+
29+
- If you prefer, you can [install Azure CLI](/cli/azure/install-azure-cli) to run the script locally. Run [az version](/cli/azure/reference-index?#az-version) to find your Azure CLI version, and run [az upgrade](/cli/azure/reference-index?#az-upgrade) if you need to upgrade. Sign in to Azure by running [az login](/cli/azure/reference-index#az-login).
2330

2431
## Sample script
2532

26-
[!INCLUDE [cli-launch-cloud-shell-sign-in.md](../../../../../includes/cli-launch-cloud-shell-sign-in.md)]
33+
This script uses the following commands:
2734

28-
### Run the script
35+
- [az group create](/cli/azure/group#az-group-create) creates a resource group to store all resources.
36+
- [az cosmosdb create](/cli/azure/cosmosdb#az-cosmosdb-create) with the `--capabilities EnableGremlin EnableServerless` parameter creates a Gremlin-enabled, serverless Azure Cosmos DB account.
37+
- [az cosmosdb gremlin database create](/cli/azure/cosmosdb/gremlin/database#az-cosmosdb-gremlin-database-create) creates an Azure Cosmos DB Gremlin database.
38+
- [az cosmosdb gremlin graph create](/cli/azure/cosmosdb/gremlin/graph#az-cosmosdb-gremlin-graph-create) creates an Azure Cosmos DB Gremlin graph.
2939

3040
:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/gremlin/serverless.sh" id="FullScript":::
3141

32-
## Clean up resources
42+
## Delete resources
3343

34-
[!INCLUDE [cli-clean-up-resources.md](../../../../../includes/cli-clean-up-resources.md)]
44+
If you don't need the resources the script created, use the [az group delete](/cli/azure/group#az-group-delete) command to delete the resource group and all resources it contains, including the Azure Cosmos DB account and database.
3545

3646
```azurecli
3747
az group delete --name $resourceGroup
3848
```
3949

40-
## Sample reference
41-
42-
This script uses the following commands. Each command in the table links to command specific documentation.
43-
44-
| Command | Notes |
45-
|---|---|
46-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
47-
| [az cosmosdb create](/cli/azure/cosmosdb#az-cosmosdb-create) | Creates an Azure Cosmos DB account. |
48-
| [az cosmosdb gremlin database create](/cli/azure/cosmosdb/gremlin/database#az-cosmosdb-gremlin-database-create) | Creates an Azure Cosmos Gremlin database. |
49-
| [az cosmosdb gremlin graph create](/cli/azure/cosmosdb/gremlin/graph#az-cosmosdb-gremlin-graph-create) | Creates an Azure Cosmos Gremlin graph. |
50-
| [az group delete](/cli/azure/resource#az-resource-delete) | Deletes a resource group including all nested resources. |
51-
5250
## Next steps
5351

54-
For more information on the Azure Cosmos DB CLI, see [Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb).
52+
[Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb)

includes/cli-clean-up-resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
ms.topic: include
3-
ms.date: 01/05/2022
3+
ms.date: 04/29/2022
44
author: dbradish-microsoft
55
ms.author: dbradish
66
manager: barbkess
77
ms.custom: devx-track-azurecli
88
---
99

10-
Use the following command to remove the resource group and all resources associated with it using the [az group delete](/cli/azure/vm/extension#az-vm-extension-set) command - unless you have an ongoing need for these resources. Some of these resources may take a while to create, as well as to delete.
10+
Use the following command to remove the resource group and all resources associated with it using the [az group delete](/cli/azure/group#az-group-delete) command - unless you have an ongoing need for these resources. Some of these resources may take a while to create, as well as to delete.

0 commit comments

Comments
 (0)