Skip to content

Commit f48f462

Browse files
author
Jayman Dalal
committed
Standardizes to EastUS2, removes zone-redundancy, hardens storage
Moves default region to eastus2 where required capacity is available and quota limits are lower. Explicitly turns off zone redundancy for Cosmos DB and Container Apps to avoid allocation failures. Forces blob public access to false to tighten storage security. Fixes misspelled `modelCapacity` parameter and cleans related comment. Bumps App Service SKU to S1 for better baseline performance while keeping capacity at 1.
1 parent 065c977 commit f48f462

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

infra/main.bicep

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,8 @@ var aiFoundryAiServicesModelDeployment = {
729729
version: '2024-08-06'
730730
sku: {
731731
name: 'GlobalStandard'
732-
//Curently the capacity is set to 140 for opinanal performance.
733-
capacity: aiFoundryAiServicesConfiguration.?modelCapcity ?? 140
732+
//Currently the capacity is set to 140 for optimal performance.
733+
capacity: aiFoundryAiServicesConfiguration.?modelCapacity ?? 140
734734
}
735735
raiPolicyName: 'Microsoft.Default'
736736
}
@@ -833,10 +833,7 @@ var aiFoundryStorageAccountResourceName = aiFoundryStorageAccountConfiguration.?
833833

834834
module aiFoundryStorageAccount 'br/public:avm/res/storage/storage-account:0.18.2' = if (aiFoundryStorageAccountEnabled) {
835835
name: take('avm.res.storage.storage-account.${aiFoundryStorageAccountResourceName}', 64)
836-
dependsOn: [
837-
privateDnsZonesAiFoundryStorageAccount
838-
]
839-
params: {
836+
params: {
840837
name: aiFoundryStorageAccountResourceName
841838
location: aiFoundryStorageAccountConfiguration.?location ?? azureOpenAILocation
842839
tags: aiFoundryStorageAccountConfiguration.?tags ?? tags
@@ -855,7 +852,7 @@ module aiFoundryStorageAccount 'br/public:avm/res/storage/storage-account:0.18.2
855852
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspace.outputs.resourceId }]
856853
}
857854
publicNetworkAccess: virtualNetworkEnabled ? 'Disabled' : 'Enabled'
858-
allowBlobPublicAccess: virtualNetworkEnabled ? false : true
855+
allowBlobPublicAccess: false
859856
privateEndpoints: virtualNetworkEnabled
860857
? map(items(storageAccountPrivateDnsZones), zone => {
861858
name: 'pep-${zone.value}-${aiFoundryStorageAccountResourceName}'
@@ -901,7 +898,7 @@ var aiFoundryAiHubEnabled = aiFoundryAiHubConfiguration.?enabled ?? true
901898
var aiFoundryAiHubName = aiFoundryAiHubConfiguration.?name ?? 'aih-${solutionPrefix}'
902899
module aiFoundryAiHub 'modules/ai-hub.bicep' = if (aiFoundryAiHubEnabled) {
903900
name: take('module.ai-hub.${aiFoundryAiHubName}', 64)
904-
dependsOn: [
901+
dependsOn: [
905902
privateDnsZonesAiFoundryWorkspaceHub
906903
]
907904
params: {
@@ -994,6 +991,7 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.12.0' = if (co
994991
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspace.outputs.resourceId }]
995992
databaseAccountOfferType: 'Standard'
996993
enableFreeTier: false
994+
defaultConsistencyLevel: 'Session'
997995
networkRestrictions: {
998996
networkAclBypass: 'None'
999997
publicNetworkAccess: virtualNetworkEnabled ? 'Disabled' : 'Enabled'
@@ -1030,6 +1028,7 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.12.0' = if (co
10301028
{
10311029
locationName: cosmosDbAccountConfiguration.?location ?? solutionLocation
10321030
failoverPriority: 0
1031+
isZoneRedundant: false
10331032
}
10341033
]
10351034
capabilitiesToAdd: [
@@ -1061,13 +1060,13 @@ var containerAppEnvironmentEnabled = containerAppEnvironmentConfiguration.?enabl
10611060
var containerAppEnvironmentResourceName = containerAppEnvironmentConfiguration.?name ?? 'cae-${solutionPrefix}'
10621061
module containerAppEnvironment 'modules/container-app-environment.bicep' = if (containerAppEnvironmentEnabled) {
10631062
name: take('module.container-app-environment.${containerAppEnvironmentResourceName}', 64)
1064-
params: {
1063+
params: {
10651064
name: containerAppEnvironmentResourceName
10661065
tags: containerAppEnvironmentConfiguration.?tags ?? tags
10671066
location: containerAppEnvironmentConfiguration.?location ?? solutionLocation
10681067
logAnalyticsResourceName: logAnalyticsWorkspace.outputs.name
10691068
publicNetworkAccess: 'Enabled'
1070-
zoneRedundant: virtualNetworkEnabled ? true : false
1069+
zoneRedundant: false
10711070
applicationInsightsConnectionString: applicationInsights.outputs.connectionString
10721071
enableTelemetry: enableTelemetry
10731072
subnetResourceId: virtualNetworkEnabled

infra/main.bicepparam

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using './main.bicep'
22

33
param solutionPrefix = null //Type a string value to customize the prefix for your resource names
4-
param solutionLocation = readEnvironmentVariable('AZURE_LOCATION', 'swedencentral')
5-
param azureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'swedencentral')
4+
param solutionLocation = readEnvironmentVariable('AZURE_LOCATION', 'eastus2')
5+
param azureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'eastus2')
66
param logAnalyticsWorkspaceConfiguration = {
77
dataRetentionInDays: 30
88
}
@@ -14,8 +14,20 @@ param virtualNetworkConfiguration = {
1414
}
1515
param aiFoundryStorageAccountConfiguration = {
1616
sku: 'Standard_LRS'
17+
allowBlobPublicAccess: false
18+
}
19+
param containerAppEnvironmentConfiguration = {
20+
zoneRedundant: false
21+
}
22+
param cosmosDbAccountConfiguration = {
23+
location: 'eastus2'
24+
// Explicitly disable zonal redundancy to avoid quota/availability issues
1725
}
1826
param webServerFarmConfiguration = {
1927
skuCapacity: 1
20-
skuName: 'B2'
28+
skuName: 'S1'
29+
}
30+
31+
param aiFoundryAiServicesConfiguration = {
32+
modelCapacity: 140 // Fix the typo in the property name
2133
}

0 commit comments

Comments
 (0)