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/errors.md
View on GitHub# Terraform Validation Errors
| Error | Fix |
|-------|-----|
| `Backend init failed` | Check storage account access |
| `Provider version conflict` | Update required_providers |
| `State lock failed` | Wait or force unlock |
| `Validation failed` | Check terraform validate output |
| `Error: Cycle:` | See [Cycle Errors](#cycle-errors) below |
## Cycle Errors
`terraform validate` reports a cycle when two or more resources reference each other's attributes, creating a circular dependency.
### Common Pattern: CORS Cross-Reference
Multi-service App Service deployments often introduce a cycle when the API's CORS configuration references the frontend hostname and the frontend's app settings reference the API hostname:
```
Error: Cycle: azurerm_linux_web_app.frontend, azurerm_linux_web_app.api
```
**Cause — circular attribute references:**
```hcl
# API references frontend.default_hostname in CORS
resource "azurerm_linux_web_app" "api" {
site_config {
cors {
allowed_origins = ["https://${azurerm_linux_web_app.frontend.default_hostname}"]
}
}
}
# Frontend references api.default_hostname in app_settings
resource "azurerm_linux_web_app" "frontend" {
app_settings = {
API_URL = "https://${azurerm_linux_web_app.api.default_hostname}"
}
}
```
### Fix Strategies
**Option A (recommended):** Use a Terraform variable for the frontend origin so CORS is restrictive by default and the cycle is broken. Define the variable with a sensible default and pass the real frontend URL after the first deployment:
```hcl
variable "frontend_origin" {
type = string
description = "Frontend origin for API CORS. Set after first deployment."
default = ""
}
resource "azurerm_linux_web_app" "api" {
site_config {
cors {
allowed_origins = var.frontend_origin != "" ? [var.frontend_origin] : ["*"]
support_credentials = var.frontend_origin != "" ? true : false
}
}
}
```
> ⚠️ **Warning:** If using `["*"]` as a temporary bootstrap value, you **must** set `frontend_origin` to the actual URL (e.g., `https://app-web-*.azurewebsites.net`) and re-run `terraform apply` in the same deployment session before reporting success. Do not leave wildcard CORS in a completed deployment.
**Option B:** Use `azurerm_app_service_custom_hostname_binding` or a `null_resource` with a `local-exec` provisioner to configure CORS after both resources are created, breaking the dependency chain.
**Option C:** Use `lifecycle { ignore_changes = [site_config[0].cors] }` on the API resource and configure CORS via a separate `azurerm_web_app_active_slot` or post-deployment script.
### After Fixing
1. Run `terraform fmt -recursive` to fix formatting
2. Re-run `terraform validate` to confirm the cycle is resolved
3. Run `terraform plan` to verify the configuration is correct
## Debug
```bash
TF_LOG=DEBUG terraform plan
```
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 |