Skip to content

fix: compile Bicep sources in generated CI templates - #152

Merged
Qi Zhang (Zhangqi910) merged 2 commits into
mainfrom
fix/4348-bicep-ci-discovery
Nov 21, 2026
Merged

Qi Zhang (Zhangqi910) merged 2 commits into
mainfrom
fix/4348-bicep-ci-discovery

Conversation

@NaseerDevops-1994

Copy link
Copy Markdown
Contributor

Overview/Summary

Fix generated GitHub Actions and Azure DevOps Bicep CI steps that report success without compiling any source files because discovery selects and then excludes the same *.bicep pattern.

Fixes Azure/Azure-Landing-Zones#4348

This PR fixes/adds/changes/removes

  1. Remove the contradictory -Exclude '*.bicep' from source discovery in both CI templates.
  2. Add -File so matching directories, including the .bicep directory itself, are not passed to the compiler.
  3. Preserve recursive discovery, the existing .bicep cache-path exclusion, and compiler error handling. Optional .bicepparam / build-params support is not included in this focused fix.

Breaking Changes

None to the template interface. CI now compiles source files as intended, so existing Bicep errors that were previously skipped will correctly fail validation.

Testing Evidence

Locally tested the actual PowerShell build steps extracted from both YAML templates using PowerShell 7 on Windows and Bicep CLI 0.46.1. All six scenarios passed, three per platform:

  • Original task: invalid nested Bicep is silently skipped and no root or nested JSON is generated, reproducing the bug.
  • Corrected task: valid root and nested Bicep files both compile to JSON. Invalid source under the excluded .bicep cache directory does not fail this case.
  • Corrected task: invalid nested Bicep produces compiler error BCP009 and the build step throws instead of reporting success.

Both YAML templates parse after removing their Terraform loop directives for isolated script extraction. git diff --check passes. The production diff is limited to one discovery command in each template.

No Azure resources were deployed. Hosted CI, Linux execution, complete Terraform template rendering, and generated-pipeline deployment E2E have not been independently validated by these local tests.

As part of this Pull Request I have

  • Checked for duplicate pull requests in https://github.com/Azure/accelerator-bootstrap-modules/pulls.
  • Associated the relevant issue for tracking and closure.
  • Based the branch on the latest fetched Azure main.
  • Performed focused testing and provided evidence above.
  • Reviewed documentation impact; no documentation changes are required for this source-discovery correction.

@Zhangqi910
Qi Zhang (Zhangqi910) merged commit c58ce10 into main Nov 21, 2026
9 checks passed
@Zhangqi910
Qi Zhang (Zhangqi910) deleted the fix/4348-bicep-ci-discovery branch November 21, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[Bug]: Generated Bicep CI templates exclude every Bicep file from build and lint

3 participants