Skip to content

Commit ea5462c

Browse files
Merge pull request #281997 from markjbrown/vector-search
Migrate to Autoscale script
2 parents ef4824c + e6d7a7f commit ea5462c

File tree

9 files changed

+105
-3
lines changed

9 files changed

+105
-3
lines changed

articles/cosmos-db/autoscale-faq.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
ms.author: dech
77
ms.service: cosmos-db
88
ms.topic: faq
9-
ms.date: 04/01/2022
9+
ms.date: 07/26/2024
1010
title: Frequently asked questions about autoscale provisioned throughput in Azure Cosmos DB
1111
summary: |
1212
[!INCLUDE[NoSQL, MongoDB, Cassandra, Gremlin, Table](includes/appliesto-nosql-mongodb-cassandra-gremlin-table.md)]
@@ -110,6 +110,8 @@ sections:
110110
The initial manual provisioned throughput is equal to the current autoscale maximum RU/s.
111111
112112
Example: You have an autoscale database or container that has a maximum RU/s of 20,000 RU/s (scales between 2,000 RU/s and 20,000 RU/s). When you update to use manual provisioned throughput, the initial throughput is 20,000 RU/s.
113+
114+
If you need to migrate a large number of throughput resources, consider using this [Azure CLI script - Convert to Autoscale](./scripts/cli/common/convert-to-autoscale.md).
113115
114116
- question: |
115117
Can I use the Azure CLI, PowerShell, or Azure Resource Manager to manage databases or containers that use autoscale?

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/how-to-choose-offer.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to choose between standard (manual) provisioned throughpu
44
author: deborahc
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 04/01/2022
7+
ms.date: 07/26/2024
88
ms.author: dech
99
---
1010

@@ -130,6 +130,10 @@ The following example shows a variable or unpredictable workload using autoscale
130130

131131
:::image type="content" source="media/how-to-choose-offer/autoscale-metrics-azure-monitor.png" alt-text="Screenshot of example workload using autoscale, with autoscale max RU/s of 50,000 RU/s and throughput ranging from 5000 - 50,000 RU/s.":::
132132

133+
## Migrate standard provisioned throughput to autoscale
134+
135+
Users that want to migrate a large number of resources from standard provisioned throughput to autoscale can use an Azure CLI script that will migrate every throughput resource in an Azure subscription to autoscale. For more details see, [Convert to Autoscale](./scripts/cli/common/convert-to-autoscale.md).
136+
133137
## Next steps
134138
* Use [RU calculator](https://cosmos.azure.com/capacitycalculator/) to estimate throughput for new workloads.
135139
* Use [Azure Monitor](monitor.md#view-operation-level-metrics-for-azure-cosmos-db) to monitor your existing workloads.

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

articles/cosmos-db/provision-throughput-autoscale.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: kirillg
55
ms.author: kirillg
66
ms.service: cosmos-db
77
ms.topic: conceptual
8-
ms.date: 04/01/2022
8+
ms.date: 07/26/2024
99
---
1010

1111
# Create Azure Cosmos DB containers and databases with autoscale throughput
@@ -74,6 +74,10 @@ For more detail, see this [documentation](how-to-choose-offer.md) on how to choo
7474
| **Pricing** | You pay for the manually provisioned RU/s per hour, using the [standard (manual) RU/s per hour rate](https://azure.microsoft.com/pricing/details/cosmos-db/). | You pay per hour for the highest RU/s the system scaled up to within the hour. <br/><br/> For single write region accounts, you pay for the RU/s used on an hourly basis, using the [autoscale RU/s per hour rate](https://azure.microsoft.com/pricing/details/cosmos-db/). <br/><br/>For accounts with multiple write regions, there's no extra charge for autoscale. You pay for the throughput used on hourly basis using the same [multi-region write RU/s per hour rate](https://azure.microsoft.com/pricing/details/cosmos-db/). |
7575
| **Best suited for workload types** | Predictable and stable workloads| Unpredictable and variable workloads |
7676

77+
## Migrate standard provisioned throughput to autoscale
78+
79+
Users that want to migrate a large number of resources from standard provisioned throughput to autoscale can use an Azure CLI script that will migrate every throughput resource in an Azure subscription to autoscale. For more details see, [Convert to Autoscale](./scripts/cli/common/convert-to-autoscale.md).
80+
7781
## Next steps
7882

7983
* Review the [autoscale FAQ](autoscale-faq.yml).
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 scenarios where there may be tens or hundreds of resources to migrate, this can be tedious 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" :::
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 Cassandra 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 Cassandra 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)