Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Prepare applications for Azure deployment by generating infrastructure code, Dockerfiles, and config files.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/recipes/terraform/README.md
1# Terraform Recipe23Terraform workflow for Azure deployments.45> **⚠️ IMPORTANT: Consider azd+Terraform First**6>7> If you're deploying to Azure, you should **default to [azd with Terraform](../azd/terraform.md)** instead of pure Terraform. azd+Terraform gives you:8> - Terraform's IaC capabilities9> - Simple `azd up` deployment workflow10> - Built-in environment management11> - Automatic CI/CD pipeline generation12> - Service orchestration from azure.yaml13>14> → **See [azd+Terraform documentation](../azd/terraform.md)** ←1516## When to Use Pure Terraform (Without azd)1718Only use pure Terraform workflow when you have specific requirements that prevent using azd:1920- **Multi-cloud deployments** where Azure is not the primary target21- **Complex Terraform modules/workspaces** that are incompatible with azd conventions22- **Existing Terraform CI/CD** pipelines that are hard to migrate23- **Organization mandate** for pure Terraform workflow without any wrapper tools24- **Explicitly requested** by the user to use Terraform without azd2526## When to Use azd+Terraform Instead2728Use azd+Terraform (the default) when:2930- **Azure-first deployment** (even if you want multi-cloud IaC)31- Want **`azd up` simplicity** with Terraform IaC32- **Multi-service apps** needing orchestration33- Team wants to learn Terraform with a simpler workflow3435→ See [azd+Terraform documentation](../azd/terraform.md)3637## Before Generation3839**REQUIRED: Research best practices before generating any files.**4041| Artifact | Research Action |42|----------|-----------------|43| Terraform patterns | Call `mcp_azure_mcp_azureterraformbestpractices` |44| Azure best practices | Call `mcp_azure_mcp_get_azure_bestpractices` |4546## Generation Steps4748### 1. Generate Infrastructure4950Create Terraform files in `./infra/`.5152→ [patterns.md](patterns.md)5354**Structure:**55```56infra/57├── main.tf58├── variables.tf59├── outputs.tf60├── terraform.tfvars61├── backend.tf62└── modules/63└── ...64```6566### 2. Set Up State Backend6768Azure Storage for remote state.6970### 3. Generate Dockerfiles (if containerized)7172Manual Dockerfile creation required.7374## Output Checklist7576| Artifact | Path |77|----------|------|78| Main config | `./infra/main.tf` |79| Variables | `./infra/variables.tf` |80| Outputs | `./infra/outputs.tf` |81| Values | `./infra/terraform.tfvars` |82| Backend | `./infra/backend.tf` |83| Modules | `./infra/modules/` |84| Dockerfiles | `src/<service>/Dockerfile` |8586## References8788- [Terraform Patterns](patterns.md)8990## Next9192→ Update `.azure/deployment-plan.md` → **azure-validate**93