feat: script-ify Terraform validation preflight sequence (azure-validate) - #2862
Merged
Tom Meschter (tmeschter) merged 2 commits intoJul 17, 2026
Merged
Conversation
Replace the manual, per-command Terraform preflight run mechanics in the azure-validate skill with a pair of run-and-report scripts (validate-terraform.sh / .ps1) that execute the full deterministic sequence in one call and emit a compact PASS/FAIL/SKIP summary plus captured error text for failed steps. README now references the scripts via markdown links with usage/examples; remediation prose and Azure Policy validation stay in prose. Fixes microsoft#2501 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 357973ca-09a4-41f9-8aaf-197779042f34
Tom Meschter (tmeschter)
requested a review
from Rick Winter (RickWinter)
as a code owner
July 16, 2026 21:10
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the azure-validate Terraform recipe to replace the manual multi-command “validation preflight sequence” with a single run-and-report script entrypoint (bash + PowerShell), reducing agent round-trips and making results easier to consume.
Changes:
- Added
validate-terraform.shandvalidate-terraform.ps1to run the deterministic Terraform preflight checks and emit PASS/FAIL/SKIP plus failure details. - Updated the Terraform recipe README to link to the scripts, provide usage/examples, and keep remediation guidance in prose.
- Centralized template-variable scanning (
{{ .Env.* }}) into the scripts to produce compact, actionable output.
Show a summary per file
| File | Description |
|---|---|
| plugin/skills/azure-validate/references/recipes/terraform/scripts/validate-terraform.sh | Adds bash implementation of the preflight runner with per-step reporting and failure details. |
| plugin/skills/azure-validate/references/recipes/terraform/scripts/validate-terraform.ps1 | Adds PowerShell implementation of the preflight runner with per-step reporting and failure details. |
| plugin/skills/azure-validate/references/recipes/terraform/README.md | Switches documentation from manual step-by-step commands to script-based usage and output interpretation. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 7
- Review effort level: Low
- Record explicit PASS/FAIL for subscription selection so a bad --subscription / -SubscriptionId fails the run instead of being silently ignored. - Stream terraform output to a temp file and only read it back on failure, avoiding holding large `terraform plan` output in memory. - Add a main.tfvars.json JSON-syntax check (issue microsoft#2501) that records PASS/FAIL/SKIP. - Align the Azure CLI install hint with the call-style used elsewhere: mcp_azure_mcp_extension_cli_install(cli-type: "az"). - Drop the duplicate per-step console output; the summary table is now the single source of results. - Update README step list and trim prose. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 357973ca-09a4-41f9-8aaf-197779042f34
JasonYeMSFT (JasonYeMSFT)
approved these changes
Jul 16, 2026
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.
Summary
Fixes #2501.
Replaces the manual, per-command Terraform validation preflight sequence in the
azure-validateskill with a pair of run-and-report scripts, per the issue's recommendation.Changes
plugin/skills/azure-validate/references/recipes/terraform/scripts/:validate-terraform.sh(bash) andvalidate-terraform.ps1(PowerShell), with feature parity../infra), optional subscription id.init→fmt -check→validate→plan→state list→ Go-style{{ .Env.* }}template-variable scan.recipes/terraform/README.mdnow references the scripts via markdown links with Usage/Examples and an output-reading guide. Remediation prose (fmt fix,{{ .Env.* }}→${VAR},TF_VAR_*,variables.tf) and the Azure Policy Validation reference stay in prose — only the run-and-report is scripted.Why
Validation
npm run buildstamps versions (azure-validate → 1.1.2).npm run referencespasses (scripts linked, not orphaned, no escaped links);npm run tokens checkpasses.azure-validatetrigger tests pass. Integration tests run in CI.