Robertjam954/multimodal_rag_application / .claude/skills/azure-validate
azure-validate
VerifiedPre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.7 KB |
| references/aspire-functions-secrets.md | markdown | 3.6 KB |
| references/global-rules.md | markdown | 1.2 KB |
| references/policy-validation.md | markdown | 1.5 KB |
| references/recipes/README.md | markdown | 374 B |
| references/recipes/azcli/README.md | markdown | 2.2 KB |
| references/recipes/azcli/errors.md | markdown | 505 B |
| references/recipes/azd/README.md | markdown | 5.3 KB |
| references/recipes/azd/aspire.md | markdown | 2.9 KB |
| references/recipes/azd/environment.md | markdown | 1.9 KB |
| references/recipes/azd/errors.md | markdown | 2.6 KB |
| references/recipes/bicep/README.md | markdown | 1.9 KB |
| references/recipes/bicep/errors.md | markdown | 374 B |
| references/recipes/terraform/README.md | markdown | 3.3 KB |
| references/recipes/terraform/errors.md | markdown | 2.8 KB |
| references/region-availability.md | markdown | 3.0 KB |
| references/role-verification.md | markdown | 3.9 KB |
references/recipes/terraform/README.md
View on GitHub# Terraform Validation
Validation steps for Terraform deployments.
## Prerequisites
- `./infra/main.tf` exists
- State backend accessible
## Validation Steps
- [ ] 1. Terraform Installation
- [ ] 2. Azure CLI Installation
- [ ] 3. Authentication
- [ ] 4. Initialize
- [ ] 5. Format Check
- [ ] 6. Validate Syntax
- [ ] 7. Plan Preview
- [ ] 8. State Backend
- [ ] 9. Azure Policy Validation
- [ ] 10. Template Variable Resolution Check (AZD+Terraform)
## Validation Details
### 1. Terraform Installation
Verify Terraform is installed:
```bash
terraform version
```
**If not installed:** See https://developer.hashicorp.com/terraform/install
### 2. Azure CLI Installation
Verify Azure CLI is installed:
```bash
az version
```
**If not installed:**
```
mcp_azure_mcp_extension_cli_install(cli-type: "az")
```
### 3. Authentication
```bash
az account show
```
**If not logged in:**
```bash
az login
az account set --subscription <subscription-id>
```
### 4. Initialize
```bash
cd infra
terraform init
```
### 5. Format Check
```bash
terraform fmt -check -recursive
```
**Fix if needed:**
```bash
terraform fmt -recursive
```
### 6. Validate Syntax
```bash
terraform validate
```
### 7. Plan Preview
```bash
terraform plan -out=tfplan
```
### 8. State Backend
Verify state is accessible:
```bash
terraform state list
```
### 9. Azure Policy Validation
See [Policy Validation Guide](../../policy-validation.md) for instructions on retrieving and validating Azure policies for your subscription.
### 10. Template Variable Resolution Check (AZD+Terraform)
> ⚠️ **CRITICAL for azd+Terraform projects.** azd substitutes `${VAR}` references in
> `main.tfvars.json` via envsubst, but does NOT interpolate Go-style template variables
> (`{{ .Env.* }}`). Unresolved Go-style template strings passed to Terraform cause
> cascading deployment failures, state conflicts, and timeouts.
**Check for Go-style template variables:**
```bash
# Check for Go-style template variables in Terraform files
grep -rn '{{ *\.Env\.' infra/ --include='*.tf' --include='*.tfvars.json' || echo "OK: No Go-style template variables found"
# Check main.tfvars.json uses correct ${VAR} syntax
if test -f infra/main.tfvars.json; then
grep -n '{{ *\.Env\.' infra/main.tfvars.json && echo "WARNING: Use \${VAR} syntax instead of {{ .Env.* }}" || echo "OK: main.tfvars.json syntax is correct"
fi
```
**If Go-style template variables are found:**
1. **Fix the syntax** in `main.tfvars.json` — replace `{{ .Env.VAR }}` with `${VAR}`:
```json
{
"environment_name": "${AZURE_ENV_NAME}",
"location": "${AZURE_LOCATION}"
}
```
2. For additional variables, use **`TF_VAR_*` environment variables**:
```bash
azd env set TF_VAR_environment_name "$(azd env get-value AZURE_ENV_NAME)"
```
3. **Verify** that `variables.tf` declares all required variables
4. **Re-run** `terraform validate` and `terraform plan` to confirm
**If `.tfvars.json` uses wrong syntax:**
- Replace Go-style `{{ .Env.* }}` with `${VAR}` (azd's envsubst format)
- Prefer putting static defaults in `variables.tf` `default` values. Using `terraform.tfvars` (HCL) for static defaults is acceptable if your team prefers it; this restriction is specifically about avoiding Go-style template expressions in `.tfvars.json` files.
## References
- [Error handling](./errors.md)
## Next
All checks pass → **azure-deploy**
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |