Skip to content

Commit a426a3a

Browse files
committed
Address feedback from Copilot
1 parent fc628e4 commit a426a3a

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

app/backend/prepdocs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,10 @@ async def main(strategy: Strategy, setup_index: bool = True):
337337

338338
load_azd_env()
339339

340-
if os.getenv("AZURE_PUBLIC_NETWORK_ACCESS") == "Disabled" and os.getenv("AZURE_USE_VPN_GATEWAY") != "true":
340+
if (
341+
os.getenv("AZURE_PUBLIC_NETWORK_ACCESS") == "Disabled"
342+
and os.getenv("AZURE_USE_VPN_GATEWAY", "").lower() != "true"
343+
):
341344
logger.error("AZURE_PUBLIC_NETWORK_ACCESS is set to Disabled. Exiting.")
342345
exit(0)
343346

infra/core/host/container-apps-environment.bicep

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ param daprEnabled bool = false
66
param logAnalyticsWorkspaceName string = ''
77
param applicationInsightsName string = ''
88

9-
@description('Virtual network name for container apps environment.')
10-
param vnetName string = ''
11-
@description('Subnet name for container apps environment integration.')
12-
param subnetName string = ''
139
param subnetResourceId string
1410

1511
param usePrivateIngress bool = true
@@ -30,11 +26,9 @@ resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2025-02-02-
3026
daprAIInstrumentationKey: daprEnabled && !empty(applicationInsightsName) ? applicationInsights.properties.InstrumentationKey : ''
3127
publicNetworkAccess: usePrivateIngress ? 'Disabled' : 'Enabled'
3228
vnetConfiguration: usePrivateIngress ? {
33-
// Use proper subnet resource ID format
3429
infrastructureSubnetId: subnetResourceId
35-
internal: usePrivateIngress
30+
internal: true
3631
} : null
37-
// Configure workload profile for dedicated environment (not consumption)
3832
workloadProfiles: usePrivateIngress
3933
? [
4034
{

infra/core/host/container-apps.bicep

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ module containerAppsEnvironment 'container-apps-environment.bicep' = {
2424
tags: tags
2525
logAnalyticsWorkspaceName: logAnalyticsWorkspaceName
2626
applicationInsightsName: applicationInsightsName
27-
vnetName: vnetName
28-
subnetName: subnetName
2927
usePrivateIngress: usePrivateIngress
3028
subnetResourceId: subnetResourceId
3129
}

infra/main.bicep

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ param webAppExists bool
300300
@allowed(['appservice', 'containerapps'])
301301
param deploymentTarget string = 'appservice'
302302
param acaIdentityName string = deploymentTarget == 'containerapps' ? '${environmentName}-aca-identity' : ''
303-
param acaManagedEnvironmentName string = deploymentTarget == 'containerapps' ? '${environmentName}-aca-envnet' : ''
303+
param acaManagedEnvironmentName string = deploymentTarget == 'containerapps' ? '${environmentName}-aca-env' : ''
304304
param containerRegistryName string = deploymentTarget == 'containerapps'
305305
? '${replace(toLower(environmentName), '-', '')}acr'
306306
: ''
@@ -542,7 +542,7 @@ module acaBackend 'core/host/container-app-upsert.bicep' = if (deploymentTarget
542542
acaIdentity
543543
]
544544
params: {
545-
name: !empty(backendServiceName) ? backendServiceName : '${abbrs.webSitesContainerApps}backend${resourceToken}'
545+
name: !empty(backendServiceName) ? backendServiceName : '${abbrs.webSitesContainerApps}backend-${resourceToken}'
546546
location: location
547547
identityName: (deploymentTarget == 'containerapps') ? acaIdentityName : ''
548548
exists: webAppExists
@@ -552,7 +552,7 @@ module acaBackend 'core/host/container-app-upsert.bicep' = if (deploymentTarget
552552
targetPort: 8000
553553
containerCpuCoreCount: '1.0'
554554
containerMemory: '2Gi'
555-
containerMinReplicas: 1
555+
containerMinReplicas: usePrivateEndpoint ? 1 : 0
556556
allowedOrigins: allowedOrigins
557557
env: union(appEnvVariables, {
558558
// For using managed identity to access Azure resources. See https://github.com/microsoft/azure-container-apps/issues/442
@@ -1155,17 +1155,15 @@ module cosmosDbRoleBackend 'core/security/documentdb-sql-role.bicep' = if (useAu
11551155
}
11561156
}
11571157

1158-
1159-
11601158
module isolation 'network-isolation.bicep' = if (usePrivateEndpoint) {
11611159
name: 'networks'
11621160
scope: resourceGroup
11631161
params: {
11641162
location: location
11651163
tags: tags
11661164
vnetName: '${abbrs.virtualNetworks}${resourceToken}'
1167-
useVpnGateway: useVpnGateway
11681165
deploymentTarget: deploymentTarget
1166+
useVpnGateway: useVpnGateway
11691167
vpnGatewayName: useVpnGateway ? '${abbrs.networkVpnGateways}${resourceToken}' : ''
11701168
dnsResolverName: useVpnGateway ? '${abbrs.privateDnsResolver}${resourceToken}' : ''
11711169
}

0 commit comments

Comments
 (0)