Skip to content

Commit 9736666

Browse files
authored
Merge pull request #189264 from carlrab/azurecli_cosmosdb
updating CosmosDB Azure CLI articles and embedded scripts
2 parents 365b163 + a0115d1 commit 9736666

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+880
-403
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,22 @@
217217
href: sql/sql-api-nodejs-samples.md
218218
- name: Python samples
219219
href: sql/sql-api-python-samples.md
220-
- name: PowerShell
220+
- name: PowerShell samples
221221
href: sql/powershell-samples.md
222-
- name: Azure CLI
223-
href: sql/cli-samples.md
222+
- name: Azure CLI samples
223+
items:
224+
- name: Overview SQL API samples
225+
href: sql/cli-samples.md
226+
- name: Create account, keyspace, and table
227+
href: scripts/cli/sql/create.md
228+
- name: Create serverless
229+
href: scripts/cli/sql/serverless.md
230+
- name: Create with autoscale
231+
href: ./scripts/cli/sql/autoscale.md
232+
- name: Perform throughput operations
233+
href: scripts/cli/sql/throughput.md
234+
- name: Lock resources from deletion
235+
href: scripts/cli/sql/lock.md
224236
- name: Azure Resource Manager
225237
href: sql/templates-samples-sql.md
226238
- name: Bicep
@@ -1020,6 +1032,22 @@
10201032
- name: 4 - Migrate data
10211033
displayName: import
10221034
href: cassandra/migrate-data.md
1035+
- name: Samples
1036+
items:
1037+
- name: Azure CLI samples
1038+
items:
1039+
- name: Overview Cassandra API samples
1040+
href: cassandra/cli-samples.md
1041+
- name: Create account, keyspace, and table
1042+
href: scripts/cli/cassandra/create.md
1043+
- name: Create serverless
1044+
href: scripts/cli/cassandra/serverless.md
1045+
- name: Create with autoscale
1046+
href: ./scripts/cli/cassandra/autoscale.md
1047+
- name: Perform throughput operations
1048+
href: scripts/cli/cassandra/throughput.md
1049+
- name: Lock resources from deletion
1050+
href: scripts/cli/cassandra/lock.md
10231051
- name: Concepts
10241052
items:
10251053
- name: FAQ
@@ -1167,6 +1195,22 @@
11671195
href: mongodb/tutorial-query-mongodb.md
11681196
- name: 3 - Distribute data globally
11691197
href: mongodb/tutorial-global-distribution-mongodb.md
1198+
- name: Samples
1199+
items:
1200+
- name: Azure CLI samples
1201+
items:
1202+
- name: Overview MongoDB API samples
1203+
href: mongodb/cli-samples.md
1204+
- name: Create account, keyspace, and table
1205+
href: scripts/cli/mongodb/create.md
1206+
- name: Create serverless
1207+
href: scripts/cli/mongodb/serverless.md
1208+
- name: Create with autoscale
1209+
href: ./scripts/cli/mongodb/autoscale.md
1210+
- name: Perform throughput operations
1211+
href: scripts/cli/mongodb/throughput.md
1212+
- name: Lock resources from deletion
1213+
href: scripts/cli/mongodb/lock.md
11701214
- name: Concepts
11711215
items:
11721216
- name: API version 4.2
@@ -1292,6 +1336,22 @@
12921336
items:
12931337
- name: 1 - Query data
12941338
href: graph/tutorial-query-graph.md
1339+
- name: Samples
1340+
items:
1341+
- name: Azure CLI samples
1342+
items:
1343+
- name: Overview Gremlin API samples
1344+
href: graph/cli-samples.md
1345+
- name: Create account, keyspace, and table
1346+
href: scripts/cli/gremlin/create.md
1347+
- name: Create serverless
1348+
href: scripts/cli/gremlin/serverless.md
1349+
- name: Create with autoscale
1350+
href: ./scripts/cli/gremlin/autoscale.md
1351+
- name: Perform throughput operations
1352+
href: scripts/cli/gremlin/throughput.md
1353+
- name: Lock resources from deletion
1354+
href: scripts/cli/gremlin/lock.md
12951355
- name: Concepts
12961356
items:
12971357
- name: FAQ
@@ -1401,6 +1461,20 @@
14011461
- name: F#
14021462
href: /dotnet/articles/fsharp/using-fsharp-on-azure/table-storage
14031463
maintainContext: true
1464+
- name: Azure CLI
1465+
items:
1466+
- name: Overview Table API samples
1467+
href: table/cli-samples.md
1468+
- name: Create account, keyspace, and table
1469+
href: scripts/cli/table/create.md
1470+
- name: Create serverless
1471+
href: scripts/cli/table/serverless.md
1472+
- name: Create with autoscale
1473+
href: ./scripts/cli/table/autoscale.md
1474+
- name: Perform throughput operations
1475+
href: scripts/cli/table/throughput.md
1476+
- name: Lock resources from deletion
1477+
href: scripts/cli/table/lock.md
14041478
- name: Concepts
14051479
items:
14061480
- name: FAQ
@@ -1441,8 +1515,22 @@
14411515
href: /cli/azure/azure-cli-reference-for-cosmos-db
14421516
- name: Samples
14431517
items:
1444-
- name: Azure Resource Graph queries
1445-
href: ./resource-graph-samples.md
1518+
- name: Azure Resource Graph queries
1519+
href: ./resource-graph-samples.md
1520+
- name: Common Azure CLI samples
1521+
items:
1522+
- name: Overview common API samples
1523+
href: common-cli-samples.md
1524+
- name: Add or fail over regions
1525+
href: scripts/cli/common/regions.md
1526+
- name: Perform account key operations
1527+
href: scripts/cli/common/keys.md
1528+
- name: Secure with IP firewall
1529+
href: scripts/cli/common/ipfirewall.md
1530+
- name: Secure new account with service endpoints
1531+
href: scripts/cli/common/service-endpoints.md
1532+
- name: Secure existing account with service endpoints
1533+
href: scripts/cli/common/service-endpoints-ignore-missing-vnet.md
14461534
- name: How-to guides
14471535
items:
14481536
- name: Free tier

articles/cosmos-db/cassandra/cli-samples.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,50 @@ author: markjbrown
55
ms.service: cosmos-db
66
ms.subservice: cosmosdb-cassandra
77
ms.topic: sample
8-
ms.date: 11/15/2021
8+
ms.date: 02/21/2022
99
ms.author: mjbrown
1010
ms.custom: devx-track-azurecli
1111
---
1212

1313
# Azure CLI samples for Azure Cosmos DB Cassandra API
14-
[!INCLUDE[appliesto-cassandra-api](../includes/appliesto-cassandra-api.md)]
1514

16-
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](/cli/azure/cosmosdb). Azure Cosmos DB CLI script samples can also be found in the [Azure Cosmos DB CLI GitHub Repository](https://github.com/Azure-Samples/azure-cli-samples/tree/master/cosmosdb).
15+
[!INCLUDE[appliesto-cassandra-api](../includes/appliesto-cassandra-api.md)]
1716

18-
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](/cli/azure/install-azure-cli)
17+
The following tables include links to sample Azure CLI scripts for the Azure Cosmos DB Cassandra API and to sample Azure CLI scripts that apply to all Cosmos DB APIs. Common samples are the same across all APIs.
1918

20-
## Common Samples
19+
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](/cli/azure/install-azure-cli). If using Azure Cloud Shell, the latest version is already installed.
2120

22-
These samples apply to all Azure Cosmos DB APIs
21+
## Cassandra API Samples
2322

2423
|Task | Description |
2524
|---|---|
26-
| [Add or failover regions](../scripts/cli/common/regions.md?toc=%2fcli%2fazure%2ftoc.json) | Add a region, change failover priority, trigger a manual failover.|
27-
| [Account keys and connection strings](../scripts/cli/common/keys.md?toc=%2fcli%2fazure%2ftoc.json) | List account keys, read-only keys, regenerate keys and list connection strings.|
28-
| [Secure with IP firewall](../scripts/cli/common/ipfirewall.md?toc=%2fcli%2fazure%2ftoc.json)| Create a Cosmos account with IP firewall configured.|
29-
| [Secure new account with service endpoints](../scripts/cli/common/service-endpoints.md?toc=%2fcli%2fazure%2ftoc.json)| Create a Cosmos account and secure with service-endpoints.|
30-
| [Secure existing account with service endpoints](../scripts/cli/common/service-endpoints-ignore-missing-vnet.md?toc=%2fcli%2fazure%2ftoc.json)| Update a Cosmos account to secure with service-endpoints when the subnet is eventually configured.|
25+
| [Create an Azure Cosmos account, keyspace and table](../scripts/cli/cassandra/create.md)| Creates an Azure Cosmos DB account, keyspace, and table for Cassandra API. |
26+
| [Create a serverless Azure Cosmos account for Cassandra API, keyspace and table](../scripts/cli/cassandra/serverless.md)| Creates a serverless Azure Cosmos DB account, keyspace, and table for Cassandra API. |
27+
| [Create an Azure Cosmos account, keyspace and table with autoscale](../scripts/cli/cassandra/autoscale.md)| Creates an Azure Cosmos DB account, keyspace, and table with autoscale for Cassandra API. |
28+
| [Perform throughput operations](../scripts/cli/cassandra/throughput.md) | Read, update and migrate between autoscale and standard throughput on a keyspace and table.|
29+
| [Lock resources from deletion](../scripts/cli/cassandra/lock.md)| Prevent resources from being deleted with resource locks.|
3130
|||
3231

33-
## Cassandra API Samples
32+
## Common API Samples
33+
34+
These samples apply to all Azure Cosmos DB APIs. These samples use a SQL (Core) API account, but these operations are identical across all database APIs in Cosmos DB.
3435

3536
|Task | Description |
3637
|---|---|
37-
| [Create an Azure Cosmos account, keyspace and table](../scripts/cli/cassandra/create.md?toc=%2fcli%2fazure%2ftoc.json)| Creates an Azure Cosmos DB account, keyspace, and table for Cassandra API. |
38-
| [Create a serverless Azure Cosmos account for Cassandra API, keyspace and table](../scripts/cli/cassandra/create.md?toc=%2fcli%2fazure%2ftoc.json)| Creates a serverless Azure Cosmos DB account, keyspace, and table for Cassandra API. |
39-
| [Create an Azure Cosmos account, keyspace and table with autoscale](../scripts/cli/cassandra/autoscale.md?toc=%2fcli%2fazure%2ftoc.json)| Creates an Azure Cosmos DB account, keyspace, and table with autoscale for Cassandra API. |
40-
| [Throughput operations](../scripts/cli/cassandra/throughput.md?toc=%2fcli%2fazure%2ftoc.json) | Read, update and migrate between autoscale and standard throughput on a keyspace and table.|
41-
| [Lock resources from deletion](../scripts/cli/cassandra/lock.md?toc=%2fcli%2fazure%2ftoc.json)| Prevent resources from being deleted with resource locks.|
38+
| [Add or fail over regions](../scripts/cli/common/regions.md) | Add a region, change failover priority, trigger a manual failover.|
39+
| [Perform account key operations](../scripts/cli/common/keys.md) | List account keys, read-only keys, regenerate keys and list connection strings.|
40+
| [Secure with IP firewall](../scripts/cli/common/ipfirewall.md)| Create a Cosmos account with IP firewall configured.|
41+
| [Secure new account with service endpoints](../scripts/cli/common/service-endpoints.md)| Create a Cosmos account and secure with service-endpoints.|
42+
| [Secure existing account with service endpoints](../scripts/cli/common/service-endpoints-ignore-missing-vnet.md)| Update a Cosmos account to secure with service-endpoints when the subnet is eventually configured.|
4243
|||
44+
45+
## Next steps
46+
47+
Reference pages for all Azure Cosmos DB CLI commands are available in the [Azure CLI Reference](/cli/azure/cosmosdb).
48+
49+
For Azure CLI samples for other APIs see:
50+
51+
- [CLI Samples for Gremlin](../graph/cli-samples.md)
52+
- [CLI Samples for MongoDB API](../mongodb/cli-samples.md)
53+
- [CLI Samples for SQL](../sql/cli-samples.md)
54+
- [CLI Samples for Table](../table/cli-samples.md)

articles/cosmos-db/cassandra/powershell-samples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ The following table includes links to commonly used Azure PowerShell scripts for
3232
|[Create an account, keyspace and table](../scripts/powershell/cassandra/create.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Creates an Azure Cosmos account, keyspace and table. |
3333
|[Create an account, keyspace and table with autoscale](../scripts/powershell/cassandra/autoscale.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Creates an Azure Cosmos account, keyspace and table with autoscale. |
3434
|[List or get keyspaces or tables](../scripts/powershell/cassandra/list-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| List or get keyspaces or tables. |
35-
|[Throughput operations](../scripts/powershell/cassandra/throughput.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Throughput operations for a keyspace or table including get, update and migrate between autoscale and standard throughput. |
35+
|[Perform throughput operations](../scripts/powershell/cassandra/throughput.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Perform throughput operations for a keyspace or table including get, update and migrate between autoscale and standard throughput. |
3636
|[Lock resources from deletion](../scripts/powershell/cassandra/lock.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Prevent resources from being deleted with resource locks. |
3737
|||
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Azure CLI Samples common to all Azure Cosmos DB APIs
3+
description: Azure CLI Samples common to all Azure Cosmos DB APIs
4+
ms.service: cosmos-db
5+
ms.subservice: cosmosdb-table
6+
ms.topic: sample
7+
ms.date: 02/22/2022
8+
author: markjbrown
9+
ms.author: mjbrown
10+
ms.custom: devx-track-azurecli
11+
---
12+
13+
# Azure CLI samples for Azure Cosmos DB API
14+
15+
[!INCLUDE[appliesto-table-api](includes/appliesto-table-api.md)]
16+
17+
The following table includes links to sample Azure CLI scripts that apply to all Cosmos DB APIs. For API specific samples, see [API specific samples](#api-specific-samples). Common samples are the same across all APIs.
18+
19+
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](/cli/azure/install-azure-cli). If using Azure Cloud Shell, the latest version is already installed.
20+
21+
## Common API Samples
22+
23+
These samples apply to all Azure Cosmos DB APIs. These samples use a SQL (Core) API account, but these operations are identical across all database APIs in Cosmos DB.
24+
25+
|Task | Description |
26+
|---|---|
27+
| [Add or fail over regions](scripts/cli/common/regions.md) | Add a region, change failover priority, trigger a manual failover.|
28+
| [Perform account key operations](scripts/cli/common/keys.md) | List account keys, read-only keys, regenerate keys and list connection strings.|
29+
| [Secure with IP firewall](scripts/cli/common/ipfirewall.md)| Create a Cosmos account with IP firewall configured.|
30+
| [Secure new account with service endpoints](scripts/cli/common/service-endpoints.md)| Create a Cosmos account and secure with service-endpoints.|
31+
| [Secure existing account with service endpoints](scripts/cli/common/service-endpoints-ignore-missing-vnet.md)| Update a Cosmos account to secure with service-endpoints when the subnet is eventually configured.|
32+
|||
33+
34+
## API specific samples
35+
36+
- [Cassandra API samples](cassandra/cli-samples.md)
37+
- [Gremlin API samples](graph/cli-samples.md)
38+
- [MongoDB API samples](mongodb/cli-samples.md)
39+
- [SQL API samples](sql/cli-samples.md)
40+
- [Table API samples](table/cli-samples.md)
41+
42+
## Next steps
43+
44+
Reference pages for all Azure Cosmos DB CLI commands are available in the [Azure CLI Reference](/cli/azure/cosmosdb).

0 commit comments

Comments
 (0)