-
Notifications
You must be signed in to change notification settings - Fork 153
Add ARM template validation with GitHub Actions and PSRule #1606
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
base: dev
Are you sure you want to change the base?
Conversation
Co-authored-by: MSBrett <24294904+MSBrett@users.noreply.github.com>
Co-authored-by: MSBrett <24294904+MSBrett@users.noreply.github.com>
Co-authored-by: MSBrett <24294904+MSBrett@users.noreply.github.com>
…n permissions Test and adjust as needed. Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace azure/setup-azure-cli@v1 with the latest supported version. As of now, the latest version is azure/setup-azure-cli@v3. Update the workflow as follows:
- name: Setup Azure CLI
uses: azure/setup-azure-cli@v3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the corrected part:
jobs:
validate_templates:
name: Validate ARM Templates
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Az PowerShell module
shell: pwsh
run: |
Install-Module -Name Az -Force -AllowClobber -Scope CurrentUser
Install-Module -Name PSRule.Rules.Azure -Force -Scope CurrentUser
- name: Setup Azure CLI
uses: azure/setup-azure-cli@v3 # Updated version
- name: Setup Bicep
uses: anthony-c-martin/setup-bicep@v0.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the Azure CLI setup action from v1 to v3 as requested. The change can be found in commit 3356e4b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Azure CLI setup action has already been updated from v1 to v3 as requested. This change was implemented in commit 3356e4b.
Co-authored-by: MSBrett <24294904+MSBrett@users.noreply.github.com>
Phase 1 implementation: - Move ARM-TTK download location from .temp to release/.tools - Disable CI/CD validation (manual dispatch only) - Update documentation with phased rollout plan - Create issue #1696 for Phase 2 template fixes - Add validation level support (Strict/Lenient modes) This allows developers to use validation locally while we fix existing template errors before enabling CI/CD validation.
This PR adds comprehensive automated validation for ARM templates as requested in the issue. The implementation includes:
🔍 New GitHub Actions Workflow
.github/workflows/arm-template-validation.yml
that will trigger on PRs affecting templates (currently disabled for Phase 1)🛠️ New PowerShell Validation Script
src/scripts/Test-ArmTemplate.ps1
for local template validation📝 Documentation Updates
docs-wiki/Build-and-test.md
about ARM template validation🚀 Phased Rollout Plan
Due to existing validation errors in our templates, we're implementing a phased rollout:
Phase 1 (This PR):
release/.tools/
(gitignored)Phase 2 (Issue #1696):
Phase 3 (Future):
Testing
To test validation locally:
This implementation gives developers the ability to validate templates locally while ensuring we don't block current development with existing validation errors.
Fixes #2.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.