Skip to content

Fix BCP104 scope resolution error in container-apps.bicep #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NeseemGit
Copy link

Fix: Resolve Bicep Scope Resolution Error in Container Apps Module

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.

Additional changes:

  • Cleaned up unused/ambiguous logic in container-apps.bicep
  • Added conditional registry module handling for external vs local resource groups

Purpose

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.


Does this introduce a breaking change?

[ ] Yes  
[x] No

Pull Request Type

[x] Bugfix  
[ ] Feature  
[ ] Code style update (formatting, local variables)  
[x] Refactoring (no functional changes, no API changes)  
[ ] Documentation content changes  
[ ] Other... Please describe:

How to Test

Tested on macOS using the following setup:

  • azd version: 1.17.0
  • Command: azd up
  • Outcome: All Azure resources provisioned successfully, including container apps and container registry.
git clone https://github.com/NeseemGit/azure-search-openai-javascript.git
cd azure-search-openai-javascript
git checkout fix/container-apps-bicep-scope-error
npm install
azd up

What to Check

  • azd up completes without BCP420 or BCP104 errors
  • Azure Container Apps and Azure Container Registry are provisioned successfully
  • Bicep templates compile and deploy cleanly
  • Web app loads successfully and backend APIs function as expected

Other Information

  • This PR resolves an Azure Bicep provisioning error (BCP104) by making scope resolution explicit
  • Prior to this fix, provisioning failed during azd up due to ambiguity in the container-apps.bicep structure

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant