Skip to content

Commit 5414d29

Browse files
feat: Working for WAF aligned change
1 parent d896727 commit 5414d29

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

infra/main.bicep

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags =
4848
param enableTelemetry bool = true
4949

5050
@description('Optional. Enable private networking for applicable resources, aligned with the WAF recommendations. Defaults to false.')
51-
param enablePrivateNetworking bool = false
51+
param enablePrivateNetworking bool = true
5252

5353
@description('Optional: Existing Log Analytics Workspace Resource ID')
5454
param existingLogAnalyticsWorkspaceId string = ''
@@ -494,6 +494,22 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
494494
value: 'AzureIdentity'
495495
}
496496
]
497+
498+
publicNetworkAccess: 'Enabled'
499+
}
500+
}
501+
502+
module avmAppConfigUpdated 'br/public:avm/res/app-configuration/configuration-store:0.6.3' = if(enablePrivateNetworking) {
503+
name: take('avm.res.app-configuration.configuration-store-update.${appConfigName}', 64)
504+
params: {
505+
name: appConfigName
506+
location: solutionLocation
507+
managedIdentities: { systemAssigned: true }
508+
sku: 'Standard'
509+
enableTelemetry: enableTelemetry
510+
tags: tags
511+
disableLocalAuth: true
512+
497513
// WAF aligned networking
498514
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
499515
privateEndpoints: enablePrivateNetworking
@@ -513,10 +529,12 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
513529
]
514530
: []
515531
}
532+
dependsOn: [
533+
avmAppConfig
534+
]
516535
}
517536

518537
// ========== Storage account module ========== //
519-
520538
var storageAccountName = 'st${solutionSuffix}'
521539
module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
522540
name: take('avm.res.storage.storage-account.${storageAccountName}', 64)
@@ -644,7 +662,6 @@ module avmSearchSearchServices 'br/public:avm/res/search/search-service:0.9.1' =
644662
}
645663

646664
// // ========== Cognitive Services - OpenAI module ========== //
647-
648665
var openAiAccountName = 'oai-${solutionSuffix}'
649666
module avmOpenAi 'br/public:avm/res/cognitive-services/account:0.13.2' = {
650667
name: take('avm.res.cognitiveservices.account.${openAiAccountName}', 64)
@@ -775,6 +792,9 @@ module managedCluster 'br/public:avm/res/container-service/managed-cluster:0.10.
775792
// userAssignedIdentity.outputs.resourceId
776793
// ]
777794
}
795+
serviceCidr: '10.20.0.0/16'
796+
dnsServiceIP: '10.20.0.10'
797+
enablePrivateCluster: false
778798
primaryAgentPoolProfiles: [
779799
{
780800
name: 'agentpool'
@@ -783,6 +803,7 @@ module managedCluster 'br/public:avm/res/container-service/managed-cluster:0.10.
783803
osType: 'Linux'
784804
mode: 'System'
785805
type: 'VirtualMachineScaleSets'
806+
vnetSubnetResourceId: enableMonitoring ? network!.outputs.subnetWebResourceId : null
786807
}
787808
]
788809
roleAssignments: [

infra/modules/network.bicep

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ module network 'network/main.bicep' = {
9090
sourcePortRange: '*'
9191
destinationPortRange: '443'
9292
sourceAddressPrefixes: ['0.0.0.0/0']
93+
destinationAddressPrefix: '*'
94+
}
95+
}
96+
{
97+
name: 'AllowHttpInbound'
98+
properties: {
99+
access: 'Allow'
100+
direction: 'Inbound'
101+
priority: 110
102+
protocol: 'Tcp'
103+
sourcePortRange: '*'
104+
destinationPortRange: '80'
105+
sourceAddressPrefixes: ['0.0.0.0/0']
93106
destinationAddressPrefixes: ['10.0.0.0/23']
94107
}
95108
}
@@ -121,7 +134,6 @@ module network 'network/main.bicep' = {
121134
}
122135
]
123136
}
124-
delegation: 'Microsoft.App/environments'
125137
}
126138
{
127139
name: 'peps'

0 commit comments

Comments
 (0)