Skip to content

Commit 81849d6

Browse files
committed
Update azuredeploy.bicep
1 parent 9eaa609 commit 81849d6

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

Labs/deploy/azuredeploy.bicep

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ var mongovCoreSettings = {
9292
mongoClusterName: '${name}-mongo'
9393
mongoClusterLogin: mongoDbUserName
9494
mongoClusterPassword: mongoDbPassword
95+
96+
mongoDatabaseName: 'cosmic_works'
97+
mongoCollectionNames: 'products,customers,sales'
9598
}
9699

97100
var appServiceSettings = {
@@ -249,13 +252,24 @@ resource appServiceWebSettings 'Microsoft.Web/sites/config@2022-03-01' = {
249252
OPENAI__COMPLETIONSDEPLOYMENT: openAiCompletionsModelDeployment.name
250253
OPENAI__MAXCONVERSATIONTOKENS: openAiSettings.maxConversationTokens
251254
OPENAI__MAXCOMPLETIONTOKENS: openAiSettings.maxCompletionTokens
252-
MONGODB__CONNECTION: 'mongodb+srv://${mongovCoreSettings.mongoClusterLogin}:${mongovCoreSettings.mongoClusterPassword}@${mongovCoreSettings.mongoClusterName}.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000'
253-
MONGODB__DATABASENAME: 'retaildb'
254-
MONGODB__COLLECTIONNAMES: 'product,customer,vectors,completions'
255+
MONGODB__DATABASENAME: mongovCoreSettings.mongoDatabaseName
256+
MONGODB__COLLECTIONNAMES: mongovCoreSettings.mongoCollectionNames
255257
MONGODB__MAXVECTORSEARCHRESULTS: '10'
256258
}
257259
}
258260

261+
resource appServiceWebConnectionStrings 'Microsoft.Web/sites/config@2022-03-01' = {
262+
parent: appServiceWeb
263+
name: 'connectionstrings'
264+
kind: 'string'
265+
properties: {
266+
MONGODB__CONNECTION: {
267+
value: 'mongodb+srv://${mongovCoreSettings.mongoClusterLogin}:${mongovCoreSettings.mongoClusterPassword}@${mongovCoreSettings.mongoClusterName}.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000'
268+
type: 'Custom'
269+
}
270+
}
271+
}
272+
259273
resource appServiceWebInsights 'Microsoft.Insights/components@2020-02-02' = {
260274
name: '${appServiceSettings.web.name}-appi'
261275
location: location
@@ -322,9 +336,20 @@ resource appServiceFunctionSettings 'Microsoft.Web/sites/config@2022-03-01' = {
322336
OPENAI__KEY: openAiAccount.listKeys().key1
323337
OPENAI__EMBEDDINGSDEPLOYMENT: openAiEmbeddingsModelDeployment.name
324338
OPENAI__MAXTOKENS: '8191'
325-
MONGODB__CONNECTION: 'mongodb+srv://${mongovCoreSettings.mongoClusterLogin}:${mongovCoreSettings.mongoClusterPassword}@${mongovCoreSettings.mongoClusterName}.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000'
326-
MONGODB__DATABASENAME: 'retaildb'
327-
MONGODB__COLLECTIONNAMES: 'product,customer,vectors,completions'
339+
MONGODB__DATABASENAME: mongovCoreSettings.mongoDatabaseName
340+
MONGODB__COLLECTIONNAMES: mongovCoreSettings.mongoCollectionNames
341+
}
342+
}
343+
344+
resource appServiceFunctionConnectionStrings 'Microsoft.Web/sites/config@2022-03-01' = {
345+
parent: appServiceFunction
346+
name: 'connectionstrings'
347+
kind: 'string'
348+
properties: {
349+
MONGODB__CONNECTION: {
350+
value: 'mongodb+srv://${mongovCoreSettings.mongoClusterLogin}:${mongovCoreSettings.mongoClusterPassword}@${mongovCoreSettings.mongoClusterName}.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000'
351+
type: 'Custom'
352+
}
328353
}
329354
}
330355

0 commit comments

Comments
 (0)