Add ARM template validation with GitHub Actions and PSRule#1606
Draft
Add ARM template validation with GitHub Actions and PSRule#1606
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>
Copilot
AI
changed the title
[WIP] ARM template deployment tests
Add ARM template validation with GitHub Actions and PSRule
May 19, 2025
…n permissions Test and adjust as needed. Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
MSBrett
reviewed
May 19, 2025
Contributor
There was a problem hiding this comment.
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
Contributor
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
I've updated the Azure CLI setup action from v1 to v3 as requested. The change can be found in commit 3356e4b.
Contributor
Author
There was a problem hiding this comment.
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>
8 tasks
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlthat will trigger on PRs affecting templates (currently disabled for Phase 1)🛠️ New PowerShell Validation Script
src/scripts/Test-ArmTemplate.ps1for local template validation📝 Documentation Updates
docs-wiki/Build-and-test.mdabout 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.