Is it possible to switch cosmosdb container from manual to autoscale using ARM templates?
I'm trying to achieve this with following arm , but I still get TU settings set to manual
{
"name": "db/collection/container/default",
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings",
"apiVersion": "2020-03-01",
"properties": {
"resource": {
"throughput": "4000",
"autoscaleSettings": {
"maxThroughput": "800000"
}
}
},
It is not possible to do this as this call is a POST on the Cosmos DB resource provider.
The only way to migrate from standard to autoscale throughput is to use the Azure Portal, PowerShell or Azure CLI. You can then modify your ARM templates and update the throughput amount by redeploying the template with the appropriate throughput json in the resources options.
Here is PS example for a container from standard to autoscale.
Invoke-AzCosmosDBSqlContainerThroughputMigration `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-ThroughputType Autoscale
More PowerShell examples
Here is cli example for a container from standard to autoscale
az cosmosdb sql container throughput migrate \
-a $accountName \
-g $resourceGroupName \
-d $databaseName \
-n $containerName \
-t 'autoscale'
More CLI examples
If doing this for other database API's find the PS or CLI examples in the docs. There are examples for all database API's.