|
| 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) |
0 commit comments