Task 02: Monitor Validate Stage
Objective: Monitor the validation stage to ensure configuration passes all checks Duration: ~2 minutes
DOCUMENT CATEGORY: Runbook SCOPE: Watch validation stage perform syntax and security checks PURPOSE: Watch validation stage perform syntax and security checks MASTER REFERENCE: Azure Pipelines Documentation
Status: Active
What Happens
The validate stage performs:
- Terraform Format Check - Ensures consistent code formatting
- Terraform Validation - Syntax and variable validation
- Security Scan - Checks for security issues (tfsec/checkov)
- Linting - Code quality checks
Procedure
1. Navigate to Pipeline
In your CI/CD platform: Pipelines → Pipelines → Click the running pipeline
2. Watch Validate Stage
Click the validate job to see real-time logs.
3. Review Output
Look for:
- ✅
terraform fmt -checkpassed - ✅
terraform validatepassed - ✅ Security scan completed
- ✅ No critical issues found
Common Issues
Issue: Format check fails
Solution: Run terraform fmt -recursive locally and recommit
Issue: Validation fails Solution: Check variable syntax, ensure all required variables defined
Issue: Security scan warnings Solution: Review findings, address critical/high severity issues
Validation
- Validate stage completed successfully (green checkmark)
- No syntax errors
- Security scan passed or warnings acknowledged
- GitHub
- GitLab
- Azure DevOps
When to use: Use this tab if your CI/CD pipeline runs on GitHub Actions.
See procedure steps above for GitHub-specific guidance.
When to use: Use this tab if your CI/CD pipeline runs on GitLab CI/CD.
See procedure steps for GitLab-specific guidance.
When to use: Use this tab if your CI/CD pipeline runs on Azure DevOps Pipelines.
See procedure steps for Azure DevOps-specific guidance.
Scripts for this task are located in the azurelocal-toolkit repository under scripts/deploy/ in the appropriate task folder.
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| Previous | Up | Next |
|---|---|---|
| Task 01 - Commit and Push | Phase 02 - Execution | Task 03 - Plan Stage |
Values from infrastructure.yml
The pipeline settings are in the devops section of infrastructure.yml (schema 5): the platform, the project, the repository, the approval environments, the runners and the Terraform state. The Terraform code does not define these values a second time. config/variables/scripts/New-IacVariableFiles.ps1 writes terraform.tfvars.json and backend.hcl from the file. See the variables reference.
Troubleshooting
| Issue | Cause | Resolution |
|---|---|---|
| Validate stage fails | Configuration validation errors | Review pipeline logs for specific validation failures |
| Stage timeout | Long-running validation checks | Increase stage timeout or investigate slow operations |
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2026-03-24 | Azure Local Cloud | Initial release |