Skip to content

Commit f0e63c1

Browse files
committed
convert autoscale script
1 parent 1e1a284 commit f0e63c1

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed

articles/cosmos-db/cassandra/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
href: ../scripts/cli/common/service-endpoints-ignore-missing-vnet.md
7575
- name: Find existing free-tier accounts
7676
href: ../scripts/cli/common/free-tier.md
77+
- name: Migrate all resources to autoscale
78+
href: ../scripts/cli/common/convert-to-autoscale.md
7779
- name: Azure PowerShell
7880
items:
7981
- name: Overview

articles/cosmos-db/gremlin/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
href: ../scripts/cli/common/service-endpoints-ignore-missing-vnet.md
5454
- name: Find existing free-tier accounts
5555
href: ../scripts/cli/common/free-tier.md
56+
- name: Migrate all resources to autoscale
57+
href: ../scripts/cli/common/convert-to-autoscale.md
5658
- name: Azure PowerShell
5759
items:
5860
- name: Overview

articles/cosmos-db/mongodb/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
href: ../scripts/cli/common/service-endpoints-ignore-missing-vnet.md
112112
- name: Find existing free-tier accounts
113113
href: ../scripts/cli/common/free-tier.md
114+
- name: Migrate all resources to autoscale
115+
href: ../scripts/cli/common/convert-to-autoscale.md
114116
- name: Azure PowerShell
115117
items:
116118
- name: Overview

articles/cosmos-db/nosql/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@
114114
href: ../scripts/cli/common/service-endpoints-ignore-missing-vnet.md
115115
- name: Find existing free-tier accounts
116116
href: ../scripts/cli/common/free-tier.md
117+
- name: Migrate all resources to autoscale
118+
href: ../scripts/cli/common/convert-to-autoscale.md
117119
- name: Azure PowerShell
118120
items:
119121
- name: Overview
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Convert all Azure Cosmos DB resources from standard to autoscale throughput
3+
description: Convert all resources to autoscale in a user subscription
4+
author: markjbrown
5+
ms.author: mjbrown
6+
ms.reviewer: mjbrown
7+
ms.service: cosmos-db
8+
ms.custom: devx-track-azurecli
9+
ms.topic: sample
10+
ms.date: 07/26/2024
11+
---
12+
13+
# Convert every Azure Cosmos DB resource from standard to autoscale throughput
14+
15+
[!INCLUDE[NoSQL, MongoDB, Cassandra, Gremlin, Table](../../../includes/appliesto-nosql-mongodb-cassandra-gremlin-table.md)]
16+
17+
The script in this article demonstrates how to convert every resource using standard provisioned throughput to autoscale within a subscription.
18+
19+
Many customers start with standard provisioned throughput when developing new applications. However standard throughput is best used in workloads that have sustained throughput requirements. Most workloads are variable. This means autoscale is often less expensive to use. In scanarios where there may be tens or hundreds of resources to migrate, this can be tedius and time consuming. This script is designed to migrate all resources in a single step.
20+
21+
22+
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
23+
24+
[!INCLUDE [azure-cli-prepare-your-environment.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment.md)]
25+
26+
- This article requires version 2.9.1 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
27+
28+
## Sample script
29+
30+
[!INCLUDE [cli-launch-cloud-shell-sign-in.md](~/reusable-content/ce-skilling/azure/includes/cli-launch-cloud-shell-sign-in.md)]
31+
32+
### Run the script
33+
34+
:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/common/convert-to-autoscale.sh" id="FullScript":::
35+
36+
## Sample reference
37+
38+
This script uses the following commands. Each command in the table links to command specific documentation.
39+
40+
| Command | Notes |
41+
|---|---|
42+
| [az group list](/cli/azure/group#az-group-list) | Lists all resource groups in an Azure subscription. |
43+
| [az cosmosdb list](/cli/azure/cosmosdb#az-cosmosdb-list) | Lists all Azure Cosmos DB accounts in a resource group. |
44+
| [az cosmosdb sql database list](/cli/azure/cosmosdb#az-cosmosdb-sql-database-list) | Lists all NoSQL databases in an account. |
45+
| [az cosmosdb sql database throughput show](/cli/azure/cosmosdb#az-cosmosdb-sql-database-throughput-show) | Read the throughput value for the NoSQL database in an account. |
46+
| [az cosmosdb sql database throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-sql-database-throughput-migrate) | Migrate the throughput for the NoSQL database resource. |
47+
| [az cosmosdb sql container list](/cli/azure/cosmosdb#az-cosmosdb-sql-container-list) | Lists all NoSQL containers in a database. |
48+
| [az cosmosdb sql container throughput show](/cli/azure/cosmosdb#az-cosmosdb-sql-container-throughput-show) | Read the throughput value for the NoSQL container in an account. |
49+
| [az cosmosdb sql container throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-sql-container-throughput-migrate) | Migrate the throughput for a NoSQL container in an account. |
50+
| [az cosmosdb mongodb database list](/cli/azure/cosmosdb#az-cosmosdb-mongodb-database-list) | Lists all MongoDB databases in an account. |
51+
| [az cosmosdb mongodb database throughput show](/cli/azure/cosmosdb#az-cosmosdb-mongodb-database-throughput-show) | Read the throughput value for the MongoDB database in an account. |
52+
| [az cosmosdb mongodb database throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-mongodb-database-throughput-migrate) | Migrate the throughput for a database resource in the MongoDB account. |
53+
| [az cosmosdb mongodb collection list](/cli/azure/cosmosdb#az-cosmosdb-mongodb-collection-list) | Lists all MongoDB collections in a database. |
54+
| [az cosmosdb mongodb collection throughput show](/cli/azure/cosmosdb#az-cosmosdb-mongodb-collection-throughput-show) | Read the throughput value for the MongoDB collection in an account. |
55+
| [az cosmosdb mongodb collection throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-mongodb-collection-throughput-migrate) | Migrate the throughput for a collection resource in the MongoDB account. |
56+
| [az cosmosdb cassandra keyspace list](/cli/azure/cosmosdb#az-cosmosdb-cassandra-keyspace-list) | Lists all Cassandra keyspaces in an account. |
57+
| [az cosmosdb cassandra keyspace throughput show](/cli/azure/cosmosdb#az-cosmosdb-cassandra-keyspace-throughput-show) | Read the throughput value for the Cassanra keyspace in an account. |
58+
| [az cosmosdb cassandra keyspace throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-cassandra-keyspace-throughput-migrate) | Migrate the throughput for a Cassanra keyspace in the account. |
59+
| [az cosmosdb cassandra table list](/cli/azure/cosmosdb#az-cosmosdb-cassandra-table-list) | Lists all Cassandra tables in a keyspace. |
60+
| [az cosmosdb cassandra table throughput show](/cli/azure/cosmosdb#az-cosmosdb-cassandra-table-throughput-show) | Read the throughput value for the Cassandra table in an account. |
61+
| [az cosmosdb cassandra table throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-cassandra-table-throughput-migrate) | Migrate the throughput for a cassandra table in an account. |
62+
| [az cosmosdb gremlin database list](/cli/azure/cosmosdb#az-cosmosdb-gremlin-database-list) | Lists all Gremlin databases in an account. |
63+
| [az cosmosdb gremlin database throughput show](/cli/azure/cosmosdb#az-cosmosdb-gremlin-database-throughput-show) | Read the throughput value for the Gremlin database in an account. |
64+
| [az cosmosdb gremlin database throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-gremlin-database-throughput-migrate) | Migrate the throughput for the Gremlin database resource. |
65+
| [az cosmosdb gremlin container list](/cli/azure/cosmosdb#az-cosmosdb-gremlin-graph-list) | Lists all Gremlin graphs in a database. |
66+
| [az cosmosdb gremlin container throughput show](/cli/azure/cosmosdb#az-cosmosdb-gremlin-graph-throughput-show) | Read the throughput value for the Gremlin graph in an account. |
67+
| [az cosmosdb gremlin graph throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-gremlin-graph-throughput-migrate) | Migrate the throughput for a Gremlin graph in an account. |
68+
| [az cosmosdb table list](/cli/azure/cosmosdb#az-cosmosdb-table-list) | Lists all Tables in an account. |
69+
| [az cosmosdb table throughput show](/cli/azure/cosmosdb#az-cosmosdb-table-throughput-show) | Read the throughput value for the table in an account. |
70+
| [az cosmosdb table throughput migrate](/cli/azure/cosmosdb#az-cosmosdb-table-throughput-migrate) | Migrate the throughput for a table in an account. |
71+
72+
## Next steps
73+
74+
For more information on the Azure Cosmos DB CLI, see [Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb).
75+
76+
For Azure CLI samples for specific APIs, see:
77+
78+
- [CLI Samples for Cassandra](../../../cassandra/cli-samples.md)
79+
- [CLI Samples for Gremlin](../../../graph/cli-samples.md)
80+
- [CLI Samples for API for MongoDB](../../../mongodb/cli-samples.md)
81+
- [CLI Samples for SQL](../../../sql/cli-samples.md)
82+
- [CLI Samples for Table](../../../table/cli-samples.md)

articles/cosmos-db/table/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
href: ../scripts/cli/common/service-endpoints-ignore-missing-vnet.md
6969
- name: Find existing free-tier accounts
7070
href: ../scripts/cli/common/free-tier.md
71+
- name: Migrate all resources to autoscale
72+
href: ../scripts/cli/common/convert-to-autoscale.md
7173
- name: Azure PowerShell
7274
items:
7375
- name: Overview

0 commit comments

Comments
 (0)