Skip to content

Commit 46e75e1

Browse files
authored
Merge pull request #345 from pamelafox/other-way
Use other approach for specifying default values
2 parents db851c7 + 8f70ef2 commit 46e75e1

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

infra/main.bicep

+8-10
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ param formRecognizerResourceGroupLocation string = location
3737

3838
param formRecognizerSkuName string = 'S0'
3939

40-
param gptDeploymentName string = ''
40+
param gptDeploymentName string // Set in main.parameters.json
4141
param gptDeploymentCapacity int = 30
4242
param gptModelName string = 'text-davinci-003'
43-
param chatGptDeploymentName string = ''
43+
param chatGptDeploymentName string // Set in main.parameters.json
4444
param chatGptDeploymentCapacity int = 30
4545
param chatGptModelName string = 'gpt-35-turbo'
4646

@@ -50,8 +50,6 @@ param principalId string = ''
5050
var abbrs = loadJsonContent('abbreviations.json')
5151
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
5252
var tags = { 'azd-env-name': environmentName }
53-
var gptDeployment = empty(gptDeploymentName) ? 'davinci' : gptDeploymentName
54-
var chatGptDeployment = empty(chatGptDeploymentName) ? 'chat' : chatGptDeploymentName
5553

5654
// Organize resources in a resource group
5755
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
@@ -111,8 +109,8 @@ module backend 'core/host/appservice.bicep' = {
111109
AZURE_OPENAI_SERVICE: openAi.outputs.name
112110
AZURE_SEARCH_INDEX: searchIndexName
113111
AZURE_SEARCH_SERVICE: searchService.outputs.name
114-
AZURE_OPENAI_GPT_DEPLOYMENT: gptDeployment
115-
AZURE_OPENAI_CHATGPT_DEPLOYMENT: chatGptDeployment
112+
AZURE_OPENAI_GPT_DEPLOYMENT: gptDeploymentName
113+
AZURE_OPENAI_CHATGPT_DEPLOYMENT: chatGptDeploymentName
116114
}
117115
}
118116
}
@@ -129,7 +127,7 @@ module openAi 'core/ai/cognitiveservices.bicep' = {
129127
}
130128
deployments: [
131129
{
132-
name: gptDeployment
130+
name: gptDeploymentName
133131
model: {
134132
format: 'OpenAI'
135133
name: gptModelName
@@ -141,7 +139,7 @@ module openAi 'core/ai/cognitiveservices.bicep' = {
141139
}
142140
}
143141
{
144-
name: chatGptDeployment
142+
name: chatGptDeploymentName
145143
model: {
146144
format: 'OpenAI'
147145
name: chatGptModelName
@@ -321,8 +319,8 @@ output AZURE_RESOURCE_GROUP string = resourceGroup.name
321319

322320
output AZURE_OPENAI_SERVICE string = openAi.outputs.name
323321
output AZURE_OPENAI_RESOURCE_GROUP string = openAiResourceGroup.name
324-
output AZURE_OPENAI_GPT_DEPLOYMENT string = gptDeployment
325-
output AZURE_OPENAI_CHATGPT_DEPLOYMENT string = chatGptDeployment
322+
output AZURE_OPENAI_GPT_DEPLOYMENT string = gptDeploymentName
323+
output AZURE_OPENAI_CHATGPT_DEPLOYMENT string = chatGptDeploymentName
326324

327325
output AZURE_FORMRECOGNIZER_SERVICE string = formRecognizer.outputs.name
328326
output AZURE_FORMRECOGNIZER_RESOURCE_GROUP string = formRecognizerResourceGroup.name

infra/main.parameters.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"value": "${AZURE_STORAGE_RESOURCE_GROUP}"
4646
},
4747
"chatGptDeploymentName": {
48-
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT}"
48+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
4949
},
5050
"gptDeploymentName": {
51-
"value": "${AZURE_OPENAI_GPT_DEPLOYMENT}"
51+
"value": "${AZURE_OPENAI_GPT_DEPLOYMENT=davinci}"
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)