Skip to content

Commit bce8d5b

Browse files
fix: Set Cosmos DB deployment location to the primary region
2 parents 956b858 + 6d38f21 commit bce8d5b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ module cosmosDBModule 'deploy_cosmos_db.bicep' = {
187187
name: 'deploy_cosmos_db'
188188
params: {
189189
accountName: 'cosmos-${solutionSuffix}'
190-
solutionLocation: secondaryLocation
190+
solutionLocation: solutionLocation
191191
keyVaultName: kvault.outputs.keyvaultName
192192
tags : tags
193193
}

infra/main.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.37.4.10188",
8-
"templateHash": "7263803858241829495"
8+
"templateHash": "10686282742508674905"
99
}
1010
},
1111
"parameters": {
@@ -166,6 +166,13 @@
166166
"metadata": {
167167
"description": "Optional. A unique text value for the solution. This is used to ensure resource names are unique for global resources. Defaults to a 5-character substring of the unique string generated from the subscription ID, resource group name, and solution name."
168168
}
169+
},
170+
"createdBy": {
171+
"type": "string",
172+
"defaultValue": "[if(empty(deployer().userPrincipalName), '', split(deployer().userPrincipalName, '@')[0])]",
173+
"metadata": {
174+
"description": "Optional created by user name"
175+
}
169176
}
170177
},
171178
"variables": {
@@ -180,7 +187,7 @@
180187
"apiVersion": "2021-04-01",
181188
"name": "default",
182189
"properties": {
183-
"tags": "[shallowMerge(createArray(parameters('tags'), createObject('TemplateName', 'KM Generic')))]"
190+
"tags": "[shallowMerge(createArray(parameters('tags'), createObject('TemplateName', 'KM Generic', 'CreatedBy', parameters('createdBy'))))]"
184191
}
185192
},
186193
{
@@ -2258,7 +2265,7 @@
22582265
"value": "[format('cosmos-{0}', variables('solutionSuffix'))]"
22592266
},
22602267
"solutionLocation": {
2261-
"value": "[parameters('secondaryLocation')]"
2268+
"value": "[variables('solutionLocation')]"
22622269
},
22632270
"keyVaultName": {
22642271
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault'), '2022-09-01').outputs.keyvaultName.value]"

0 commit comments

Comments
 (0)