Skip to content

Commit 8b7b2b8

Browse files
Remove unused private endpoint configurations and ensure public network access is enabled for Container App Environment and Web App.
1 parent 16a3ea8 commit 8b7b2b8

File tree

1 file changed

+2
-52
lines changed

1 file changed

+2
-52
lines changed

infra/main.bicep

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,6 @@ var privateDnsZones = [
917917
'privatelink.openai.azure.com'
918918
'privatelink.services.ai.azure.com'
919919
'privatelink.documents.azure.com'
920-
'privatelink.${toLower(replace(location,' ',''))}.azurecontainerapps.io'
921-
'privatelink.azurewebsites.net'
922920
]
923921

924922
// DNS Zone Index Constants
@@ -927,8 +925,6 @@ var dnsZoneIndex = {
927925
openAI: 1
928926
aiServices: 2
929927
cosmosDb: 3
930-
containerAppEnvironment: 4
931-
appService: 5
932928
}
933929

934930
// List of DNS zone indices that correspond to AI-related services.
@@ -1247,8 +1243,8 @@ module containerAppEnvironment 'br/public:avm/res/app/managed-environment:0.11.2
12471243
tags: tags
12481244
enableTelemetry: enableTelemetry
12491245
// WAF aligned configuration for Private Networking
1250-
publicNetworkAccess: 'Enabled' // Always enabling the public network access for Container App Environment
1251-
internal: enablePrivateNetworking ? true : false
1246+
publicNetworkAccess: 'Enabled' // Always enabling the publicNetworkAccess for Container App Environment
1247+
internal: false // Must be false when publicNetworkAccess is'Enabled'
12521248
infrastructureSubnetResourceId: enablePrivateNetworking ? virtualNetwork.?outputs.?subnetResourceIds[3] : null
12531249
// WAF aligned configuration for Monitoring
12541250
appLogsConfiguration: enableMonitoring
@@ -1282,43 +1278,12 @@ module containerAppEnvironment 'br/public:avm/res/app/managed-environment:0.11.2
12821278
}
12831279
}
12841280

1285-
// Private Endpoint for Container App Environment
1286-
var privateEndpointContainerAppEnvironmentService = 'managedEnvironments'
1287-
module privateEndpointContainerAppEnvironment 'br:mcr.microsoft.com/bicep/avm/res/network/private-endpoint:0.11.0' = if (enablePrivateNetworking) {
1288-
name: take('avm.res.network.private-endpoint.app-environment.${solutionSuffix}', 64)
1289-
params: {
1290-
name: 'pep-${containerAppEnvironmentResourceName}'
1291-
location: location
1292-
tags: tags
1293-
enableTelemetry: enableTelemetry
1294-
subnetResourceId: virtualNetwork!.outputs.subnetResourceIds[0]
1295-
customNetworkInterfaceName: 'nic-${containerAppEnvironmentResourceName}'
1296-
privateLinkServiceConnections: [
1297-
{
1298-
name: '${last(split(containerAppEnvironment.outputs.resourceId, '/'))}-${privateEndpointContainerAppEnvironmentService}-0'
1299-
properties: {
1300-
groupIds: [privateEndpointContainerAppEnvironmentService]
1301-
privateLinkServiceId: containerAppEnvironment.outputs.resourceId
1302-
}
1303-
}
1304-
]
1305-
privateDnsZoneGroup: {
1306-
privateDnsZoneGroupConfigs: [
1307-
{ privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.containerAppEnvironment]!.outputs.resourceId }
1308-
]
1309-
}
1310-
}
1311-
}
1312-
13131281
// ========== Backend Container App Service ========== //
13141282
// WAF best practices for container apps: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-container-apps
13151283
// PSRule for Container App: https://azure.github.io/PSRule.Rules.Azure/en/rules/resource/#container-app
13161284
var containerAppResourceName = 'ca-${solutionSuffix}'
13171285
module containerApp 'br/public:avm/res/app/container-app:0.18.1' = {
13181286
name: take('avm.res.app.container-app.${containerAppResourceName}', 64)
1319-
dependsOn: [
1320-
privateEndpointContainerAppEnvironment
1321-
]
13221287
params: {
13231288
name: containerAppResourceName
13241289
tags: tags
@@ -1509,21 +1474,6 @@ module webSite 'modules/web-sites.bicep' = {
15091474
vnetImagePullEnabled: enablePrivateNetworking ? true : false
15101475
virtualNetworkSubnetId: enablePrivateNetworking ? virtualNetwork!.outputs.subnetResourceIds[4] : null
15111476
publicNetworkAccess: 'Enabled' // Always enabling the public network access for Web App
1512-
privateEndpoints: enablePrivateNetworking
1513-
? [
1514-
{
1515-
name: 'pep-${webSiteResourceName}'
1516-
customNetworkInterfaceName: 'nic-${webSiteResourceName}'
1517-
privateDnsZoneGroup: {
1518-
privateDnsZoneGroupConfigs: [
1519-
{ privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.appService]!.outputs.resourceId }
1520-
]
1521-
}
1522-
service: 'sites'
1523-
subnetResourceId: virtualNetwork!.outputs.subnetResourceIds[0]
1524-
}
1525-
]
1526-
: null
15271477
}
15281478
}
15291479

0 commit comments

Comments
 (0)