Skip to content

Commit b514ddb

Browse files
refactor: standardize parameter naming for Azure OpenAI location and remove AZURE_LOCATION parameters
1 parent 6152da1 commit b514ddb

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

infra/main.bicep

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ metadata description = 'This module contains the resources required to deploy th
55
@maxLength(19)
66
param solutionPrefix string = 'macae${uniqueString(deployer().objectId, deployer().tenantId, subscription().subscriptionId, resourceGroup().id)}'
77

8+
@description('Required. Location for all Resources except AI Foundry.')
9+
param solutionLocation string = resourceGroup().location
10+
811
@description('Optional. Enable/Disable usage telemetry for module.')
912
param enableTelemetry bool = true
1013

1114
// Restricting deployment to only supported Azure OpenAI regions validated with GPT-4o model
1215
@allowed(['australiaeast','eastus2','francecentral','japaneast','norwayeast','swedencentral','uksouth', 'westus'])
1316
@description('Azure OpenAI Location')
14-
param AzureOpenAILocation string
17+
param azureOpenAILocation string
1518

16-
@description('Set this if you want to deploy to a different region than the resource group. Otherwise, it will use the resource group location by default.')
17-
param AZURE_LOCATION string=''
18-
param solutionLocation string = empty(AZURE_LOCATION) ? resourceGroup().location : AZURE_LOCATION
19+
// @description('Set this if you want to deploy to a different region than the resource group. Otherwise, it will use the resource group location by default.')
20+
// param AZURE_LOCATION string=''
21+
// param solutionLocation string = empty(AZURE_LOCATION) ? resourceGroup().location
1922

2023
@description('Optional. The tags to apply to all deployed Azure resources.')
2124
param tags object = {
@@ -123,7 +126,7 @@ param virtualMachineConfiguration virtualMachineConfigurationType = {
123126
param aiFoundryAiServicesConfiguration aiServicesConfigurationType = {
124127
enabled: true
125128
name: 'aisa-${solutionPrefix}'
126-
location: AzureOpenAILocation
129+
location: azureOpenAILocation
127130
sku: 'S0'
128131
deployments: null //Default value set on module configuration
129132
subnetResourceId: null //Default value set on module configuration
@@ -133,7 +136,7 @@ param aiFoundryAiServicesConfiguration aiServicesConfigurationType = {
133136
param aiFoundryStorageAccountConfiguration storageAccountType = {
134137
enabled: true
135138
name: replace('sthub${solutionPrefix}', '-', '')
136-
location: AzureOpenAILocation
139+
location: azureOpenAILocation
137140
tags: tags
138141
sku: 'Standard_ZRS'
139142
subnetResourceId: null //Default value set on module configuration
@@ -143,7 +146,7 @@ param aiFoundryStorageAccountConfiguration storageAccountType = {
143146
param aiFoundryAiHubConfiguration aiHubType = {
144147
enabled: true
145148
name: 'aih-${solutionPrefix}'
146-
location: AzureOpenAILocation
149+
location: azureOpenAILocation
147150
sku: 'Basic'
148151
tags: tags
149152
subnetResourceId: null //Default value set on module configuration
@@ -153,7 +156,7 @@ param aiFoundryAiHubConfiguration aiHubType = {
153156
param aiFoundryAiProjectConfiguration aiProjectConfigurationType = {
154157
enabled: true
155158
name: 'aihb-${solutionPrefix}'
156-
location: AzureOpenAILocation
159+
location: azureOpenAILocation
157160
sku: 'Basic'
158161
tags: tags
159162
}
@@ -735,7 +738,7 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.10.2'
735738
params: {
736739
name: aiFoundryAiServicesResourceName
737740
tags: aiFoundryAiServicesConfiguration.?tags ?? tags
738-
location: aiFoundryAiServicesConfiguration.?location ?? solutionLocation
741+
location: aiFoundryAiServicesConfiguration.?location ?? azureOpenAILocation
739742
enableTelemetry: enableTelemetry
740743
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspace.outputs.resourceId }]
741744
sku: aiFoundryAiServicesConfiguration.?sku ?? 'S0'
@@ -833,7 +836,7 @@ module aiFoundryStorageAccount 'br/public:avm/res/storage/storage-account:0.18.2
833836
]
834837
params: {
835838
name: aiFoundryStorageAccountResourceName
836-
location: aiFoundryStorageAccountConfiguration.?location ?? solutionLocation
839+
location: aiFoundryStorageAccountConfiguration.?location ?? azureOpenAILocation
837840
tags: aiFoundryStorageAccountConfiguration.?tags ?? tags
838841
enableTelemetry: enableTelemetry
839842
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspace.outputs.resourceId }]
@@ -901,7 +904,7 @@ module aiFoundryAiHub 'modules/ai-hub.bicep' = if (aiFoundryAiHubEnabled) {
901904
]
902905
params: {
903906
name: aiFoundryAiHubName
904-
location: aiFoundryAiHubConfiguration.?location ?? solutionLocation
907+
location: aiFoundryAiHubConfiguration.?location ?? azureOpenAILocation
905908
tags: aiFoundryAiHubConfiguration.?tags ?? tags
906909
sku: aiFoundryAiHubConfiguration.?sku ?? 'Basic'
907910
aiFoundryAiServicesName: aiFoundryAiServices.outputs.name
@@ -940,7 +943,7 @@ module aiFoundryAiProject 'br/public:avm/res/machine-learning-services/workspace
940943
name: take('avm.res.machine-learning-services.workspace.${aiFoundryAiProjectName}', 64)
941944
params: {
942945
name: aiFoundryAiProjectName
943-
location: aiFoundryAiProjectConfiguration.?location ?? solutionLocation
946+
location: aiFoundryAiProjectConfiguration.?location ?? azureOpenAILocation
944947
tags: aiFoundryAiProjectConfiguration.?tags ?? tags
945948
enableTelemetry: enableTelemetry
946949
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspace.outputs.resourceId }]
@@ -1166,7 +1169,7 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
11661169
}
11671170
{
11681171
name: 'AZURE_AI_AGENT_PROJECT_CONNECTION_STRING'
1169-
value: '${toLower(replace(AzureOpenAILocation,' ',''))}.api.azureml.ms;${subscription().subscriptionId};${resourceGroup().name};${aiFoundryAiProjectName}'
1172+
value: '${toLower(replace(azureOpenAILocation,' ',''))}.api.azureml.ms;${subscription().subscriptionId};${resourceGroup().name};${aiFoundryAiProjectName}'
11701173
//Location should be the AI Foundry AI Project location
11711174
}
11721175
{

infra/main.bicepparam

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ param webServerFarmConfiguration = {
1919
skuCapacity: 1
2020
skuName: 'B2'
2121
}
22-
param AzureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'swedencentral')
23-
param AZURE_LOCATION = readEnvironmentVariable('AZURE_LOCATION', '')
22+
param azureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'swedencentral')

0 commit comments

Comments
 (0)