@@ -446,6 +446,7 @@ var privateDnsZones = [
446446 'privatelink.documents.azure.com'
447447 'privatelink${environment ().suffixes .sqlServerHostname }'
448448 'privatelink.search.windows.net'
449+ 'privatelink.azurewebsites.net'
449450]
450451
451452// DNS Zone Index Constants
@@ -460,6 +461,7 @@ var dnsZoneIndex = {
460461 cosmosDB : 7
461462 sqlServer : 8
462463 search : 9
464+ webApp : 10
463465}
464466
465467// ===================================================
@@ -1363,7 +1365,22 @@ module webSiteBackend 'modules/web-sites.bicep' = {
13631365 vnetRouteAllEnabled : enablePrivateNetworking ? true : false
13641366 vnetImagePullEnabled : enablePrivateNetworking ? true : false
13651367 virtualNetworkSubnetId : enablePrivateNetworking ? virtualNetwork !.outputs .webSubnetResourceId : null
1366- publicNetworkAccess : 'Enabled'
1368+ publicNetworkAccess : enablePrivateNetworking ? 'Disabled' : 'Enabled'
1369+ privateEndpoints : enablePrivateNetworking
1370+ ? [
1371+ {
1372+ name : 'pep-${backendWebSiteResourceName }'
1373+ customNetworkInterfaceName : 'nic-${backendWebSiteResourceName }'
1374+ privateDnsZoneGroup : {
1375+ privateDnsZoneGroupConfigs : [
1376+ { privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .webApp ]!.outputs .resourceId }
1377+ ]
1378+ }
1379+ service : 'sites'
1380+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
1381+ }
1382+ ]
1383+ : []
13671384 }
13681385}
13691386
@@ -1391,9 +1408,10 @@ module webSiteFrontend 'modules/web-sites.bicep' = {
13911408 properties : {
13921409 SCM_DO_BUILD_DURING_DEPLOYMENT : 'true'
13931410 ENABLE_ORYX_BUILD : 'true'
1394- REACT_APP_API_BASE_URL : 'https://api-${solutionSuffix }.azurewebsites.net'
1411+ REACT_APP_API_BASE_URL : enablePrivateNetworking ? '' : 'https://api-${solutionSuffix }.azurewebsites.net'
13951412 WEBSITE_NODE_DEFAULT_VERSION : '~20'
1396- APP_API_BASE_URL : 'https://api-${solutionSuffix }.azurewebsites.net'
1413+ APP_API_BASE_URL : enablePrivateNetworking ? '' : 'https://api-${solutionSuffix }.azurewebsites.net'
1414+ BACKEND_API_HOST : enablePrivateNetworking ? 'api-${solutionSuffix }.azurewebsites.net' : ''
13971415 }
13981416 applicationInsightResourceId : enableMonitoring ? applicationInsights !.outputs .resourceId : null
13991417 }
0 commit comments