Skip to content

Conversation

@riosengineer
Copy link
Owner

This pull request introduces examples and implementations of the fail() function in Azure Bicep templates, showcasing how it can enforce validation rules during deployments. The changes include detailed documentation, example templates for storage accounts and web apps, and parameter files for testing these templates.

Documentation Updates:

  • bicep-examples/fail-function/README.md: Added a comprehensive guide on the fail() function, including benefits, examples for enforcing naming conventions and runtime validation, and deployment instructions for CLI and PowerShell.

Storage Account Template:

Web App Template:

@riosengineer riosengineer requested a review from Copilot June 5, 2025 15:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces examples and implementations of the fail() function in Azure Bicep templates to enforce deployment validations. Key changes include detailed documentation updates, a storage account template that checks naming conventions using fail(), and a web app template that validates the runtime stack.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bicep-examples/fail-function/README.md Adds comprehensive documentation for the fail() function
bicep-examples/fail-function/storage.bicep Implements a storage account template with naming validation
bicep-examples/fail-function/storage.bicepparam Provides parameters for the storage account template
bicep-examples/fail-function/webApp.bicep Creates a web app template with runtime validation using fail()
bicep-examples/fail-function/webApp.bicepparam Provides parameters for the web app template, demonstrating a failing case
Comments suppressed due to low confidence (1)

bicep-examples/fail-function/webApp.bicepparam:4

  • The inline comment above suggests using "DOTNETCORE|9.0" to bypass the fail() check, but the provided runtime value will trigger failure. Consider clarifying whether this file is intended to demonstrate a failing case or if an additional parameter file with a passing example should be provided.
param runtime = 'PYTHON|3.11'

@github-actions
Copy link

github-actions bot commented Jun 5, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ MARKDOWN markdownlint 1 0 0 0.58s
✅ MARKDOWN markdown-link-check 1 0 0 0.84s
✅ MARKDOWN markdown-table-formatter 1 0 0 0.21s
✅ REPOSITORY devskim yes no no 1.47s
✅ REPOSITORY dustilock yes no no 0.01s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY secretlint yes no no 0.77s
✅ REPOSITORY syft yes no no 1.92s
❌ REPOSITORY trivy yes 1 no 7.04s
✅ REPOSITORY trivy-sbom yes no no 0.15s
✅ REPOSITORY trufflehog yes no no 3.83s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@riosengineer riosengineer merged commit 60a5d2a into main Jun 5, 2025
1 check failed
@riosengineer riosengineer deleted the fail-function-example branch June 5, 2025 15:51
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.

2 participants