Skip to content

Commit 7f523a0

Browse files
committed
Fix deployment with app service
1 parent 9dc65ca commit 7f523a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

infra/main.bicep

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ module backend 'core/host/appservice.bicep' = if (deploymentTarget == 'appservic
362362

363363
// identity for pulling images from ACR
364364
module acaIdentity 'core/security/aca-identity.bicep' = if (deploymentTarget == 'containerapps') {
365-
name: acaIdentityName
365+
name: 'aca-identity'
366366
scope: resourceGroup
367367
params: {
368368
identityName: acaIdentityName
@@ -394,11 +394,11 @@ module acaBackend 'core/host/container-app-upsert.bicep' = if (deploymentTarget
394394
params: {
395395
name: !empty(backendServiceName) ? backendServiceName : '${abbrs.webSitesContainerApps}backend-${resourceToken}'
396396
location: location
397-
identityName: acaIdentity.name
397+
identityName: (deploymentTarget == 'containerapps') ? acaIdentity.name : ''
398398
exists: webAppExists
399399
workloadProfile: azureContainerAppsWorkloadProfile
400-
containerRegistryName: containerApps.outputs.registryName
401-
containerAppsEnvironmentName: containerApps.outputs.environmentName
400+
containerRegistryName: (deploymentTarget == 'containerapps') ? containerApps.outputs.registryName : ''
401+
containerAppsEnvironmentName: (deploymentTarget == 'containerapps') ? containerApps.outputs.environmentName : ''
402402
identityType: 'UserAssigned'
403403
tags: union(tags, { 'azd-service-name': 'backend' })
404404
targetPort: 8000
@@ -460,7 +460,7 @@ module acaBackend 'core/host/container-app-upsert.bicep' = if (deploymentTarget
460460
USE_LOCAL_PDF_PARSER: useLocalPdfParser
461461
USE_LOCAL_HTML_PARSER: useLocalHtmlParser
462462
// For using managed identity to access Azure resources. See https://github.com/microsoft/azure-container-apps/issues/442
463-
AZURE_CLIENT_ID: acaIdentity.outputs.clientId
463+
AZURE_CLIENT_ID: (deploymentTarget == 'containerapps') ? acaIdentity.outputs.clientId : ''
464464
}
465465
}
466466
}

0 commit comments

Comments
 (0)