Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 3.38 KB

File metadata and controls

63 lines (45 loc) · 3.38 KB
title description author ms.service ms.subservice ms.custom ms.topic ms.date ms.author ms.reviewer
PowerShell scripts for throughput (RU/s) operations for Azure Cosmos DB for NoSQL database or container
PowerShell scripts for throughput (RU/s) operations for Azure Cosmos DB for NoSQL database or container
seesharprun
cosmos-db
nosql
devx-track-azurepowershell
sample
10/07/2020
sidandrews
mjbrown

Throughput (RU/s) operations with PowerShell for a database or container for Azure Cosmos DB for NoSQL

[!INCLUDENoSQL]

[!INCLUDE updated-for-az]

This sample requires Azure PowerShell Az 5.4.0 or later. Run Get-Module -ListAvailable Az to see which versions are installed. If you need to install, see Install Azure PowerShell module.

Run Connect-AzAccount to sign in to Azure.

Get throughput

[!code-powershellmain]

Update throughput

[!code-powershellmain]

Migrate throughput

[!code-powershellmain]

Clean up deployment

After the script sample has been run, the following command can be used to remove the resource group and all resources associated with it.

Remove-AzResourceGroup -ResourceGroupName "myResourceGroup"

Script explanation

This script uses the following commands. Each command in the table links to command specific documentation.

Command Notes
Azure Cosmos DB
Get-AzCosmosDBSqlDatabaseThroughput Get the throughput provisioned on an Azure Cosmos DB for NoSQL Database.
Get-AzCosmosDBSqlContainerThroughput Get the throughput provisioned on an Azure Cosmos DB for NoSQL Container.
Update-AzCosmosDBSqlDatabaseThroughput Updates the throughput value of an Azure Cosmos DB for NoSQL Database.
Update-AzCosmosDBSqlContainerThroughput Updates the throughput value of an Azure Cosmos DB for NoSQL Container.
Invoke-AzCosmosDBSqlDatabaseThroughputMigration Migrate throughput of an Azure Cosmos DB for NoSQL Database.
Invoke-AzCosmosDBSqlContainerThroughputMigration Migrate throughput of an Azure Cosmos DB for NoSQL Container.
Azure Resource Groups
Remove-AzResourceGroup Deletes a resource group including all nested resources.

Next steps

For more information on the Azure PowerShell, see Azure PowerShell documentation.