From 9ddc008325f9f125785c7b473328ca628b180c96 Mon Sep 17 00:00:00 2001 From: Sidney Andrews Date: Tue, 8 Oct 2024 10:47:19 -0400 Subject: [PATCH 1/2] Change to container throughput --- infra/app/data.bicep | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/infra/app/data.bicep b/infra/app/data.bicep index 65c7527..98f5839 100644 --- a/infra/app/data.bicep +++ b/infra/app/data.bicep @@ -5,8 +5,6 @@ param tags object = {} var database = { name: 'cosmicworks' // Based on AdventureWorksLT data set - autoscale: true // Scale at the database level - throughput: 1000 // Enable autoscale with a minimum of 100 RUs and a maximum of 1,000 RUs } var containers = [ @@ -15,6 +13,8 @@ var containers = [ partitionKeyPaths: [ '/category' // Partition on the product category ] + autoscale: true // Scale at the container level + throughput: 1000 // Enable autoscale with a minimum of 100 RUs and a maximum of 1,000 RUs } ] @@ -24,9 +24,7 @@ module cosmosDbDatabase '../core/database/cosmos-db/nosql/database.bicep' = { name: database.name parentAccountName: databaseAccountName tags: tags - setThroughput: true - autoscale: database.autoscale - throughput: database.throughput + setThroughput: false } } @@ -37,7 +35,9 @@ module cosmosDbContainers '../core/database/cosmos-db/nosql/container.bicep' = [ parentAccountName: databaseAccountName parentDatabaseName: cosmosDbDatabase.outputs.name tags: tags - setThroughput: false + setThroughput: true + autoscale: container.autoscale + throughput: container.throughput partitionKeyPaths: container.partitionKeyPaths } }] From dc5ca8e0cb74dda326c4a86ee256cc7edf5e376c Mon Sep 17 00:00:00 2001 From: Sidney Andrews Date: Tue, 8 Oct 2024 11:04:40 -0400 Subject: [PATCH 2/2] Add new endpoint logic --- infra/core/database/cosmos-db/account.bicep | 1 - infra/core/database/cosmos-db/nosql/account.bicep | 2 +- infra/core/database/cosmos-db/table/account.bicep | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/infra/core/database/cosmos-db/account.bicep b/infra/core/database/cosmos-db/account.bicep index 9a01506..aba6d99 100644 --- a/infra/core/database/cosmos-db/account.bicep +++ b/infra/core/database/cosmos-db/account.bicep @@ -50,5 +50,4 @@ resource account 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = { } } -output endpoint string = account.properties.documentEndpoint output name string = account.name diff --git a/infra/core/database/cosmos-db/nosql/account.bicep b/infra/core/database/cosmos-db/nosql/account.bicep index 998ed45..bb21159 100644 --- a/infra/core/database/cosmos-db/nosql/account.bicep +++ b/infra/core/database/cosmos-db/nosql/account.bicep @@ -22,5 +22,5 @@ module account '../account.bicep' = { } } -output endpoint string = account.outputs.endpoint +output endpoint string = 'https://${account.outputs.name}.documents.azure.com:443/' output name string = account.outputs.name diff --git a/infra/core/database/cosmos-db/table/account.bicep b/infra/core/database/cosmos-db/table/account.bicep index e031083..bc02a11 100644 --- a/infra/core/database/cosmos-db/table/account.bicep +++ b/infra/core/database/cosmos-db/table/account.bicep @@ -27,5 +27,5 @@ module account '../account.bicep' = { } } -output endpoint string = account.outputs.endpoint +output endpoint string = 'https://${account.outputs.name}.table.cosmos.azure.com:443/' output name string = account.outputs.name