I am trying to set up an release pipeline in Azure DevOps that deploy an Azure environment using Azure Resource Manager Templates. One of the resources I want to create is a Cosmos DB instance using the Azure Table Api and I want to provision "Account level throughput" for the whole database and not pr. table. I am able to create the Cosmos DB instance with the correct api through the ARM template, but I'm not able to set "Account level throughput" to "On" through the template or by using the Microsoft.Azure.Cosmos.Table api.
The only way I'm able to configure this is by logging into the Azure portal and do it manually. Is it possible to automate this through the ARM template or by using Powershell or the Microsoft.Azure.Cosmos.Table api?
This is the template I use at the moment
{
"type": "Microsoft.DocumentDB/databaseAccounts",
"name": "[variables('cosmosStreamDBName')]",
"apiVersion": "2016-03-31",
"location": "[parameters('location')]",
"tags": {
"defaultExperience": "Azure Table"
},
"kind": "GlobalDocumentDB",
"properties": {
"capabilities": [ { "name": "EnableTable" } ],
"consistencyPolicy": {
"defaultConsistencyLevel": "BoundedStaleness",
"maxIntervalInSeconds": 86400,
"maxStalenessPrefix": 1000000
},
"databaseAccountOfferType": "Standard",
"enableAutomaticFailover": false,
"enableMultipleWriteLocations": false,
"isVirtualNetworkFilterEnabled": false,
"virtualNetworkRules": [],
"locations": [
{
"locationName": "[parameters('location')]",
"failoverPriority": 0
}
]
}
}
This is an example on how I provision the throughput on database level when using the SQL api:
var client = new DocumentClient(
new Uri(EndpointUri),
PrimaryKey,
serializerSettings: Settings
);
var db = await client.CreateDatabaseIfNotExistsAsync(
new Database { Id = DatabaseName },
new RequestOptions() {
PartitionKey = new PartitionKey(key),
OfferThroughput = 400
}
);