From 958d2edf51e01bb1673200f7bbb67738538883d1 Mon Sep 17 00:00:00 2001 From: Neseem Date: Fri, 13 Jun 2025 14:11:42 -0700 Subject: [PATCH] Fix BCP104 scope resolution error in container-apps.bicep Resolved a Bicep compile-time error (BCP104) by restructuring the container registry module call. Previously, the `containerRegistryAccess` module used `userIdentity.properties.principalId` in a way that made scope resolution ambiguous during provisioning. This fix wraps the module call with an explicit `if` condition and simplifies the logic, making it resolvable at compile time. Tested with `azd up` using azd version 1.17.0 on macOS and verified successful provisioning of Azure resources. Also: - Cleaned up unused/ambiguous logic in container-apps.bicep - Added conditional registry module handling for external vs local resource group --- infra/core/host/container-apps.bicep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/core/host/container-apps.bicep b/infra/core/host/container-apps.bicep index 1c656e28..5d415880 100644 --- a/infra/core/host/container-apps.bicep +++ b/infra/core/host/container-apps.bicep @@ -21,9 +21,9 @@ module containerAppsEnvironment 'container-apps-environment.bicep' = { } } -module containerRegistry 'container-registry.bicep' = { +// Deploy container registry to specified resource group or current resource group +module containerRegistry 'container-registry.bicep' = if (empty(containerRegistryResourceGroupName)) { name: '${name}-container-registry' - scope: !empty(containerRegistryResourceGroupName) ? resourceGroup(containerRegistryResourceGroupName) : resourceGroup() params: { name: containerRegistryName location: location