What problem does it solve?
First-time Azure Terraform deployments frequently fail due to unverified prerequisites like unauthenticated Azure CLI, incompatible SSH keys, existing resources not imported into Terraform state, or outdated Terraform versions, leading to hours of avoidable debugging and failed apply runs.
Core Features & Use Cases
- Prerequisite Validation: Confirms Azure CLI and Terraform (>=1.6) are installed and accessible, stopping immediately if either is missing.
- Authentication & Context Setup: Verifies active Azure login, saves subscription context to avoid repeated logins in future sessions.
- SSH Key Compliance: Checks for RSA SSH keys (required by Azure, which rejects ed25519 for Linux VMs) and generates compliant keys if none exist.
- Existing Resource Handling: Detects if target resource groups already exist, lists all existing resources, and auto-generates Terraform import blocks to avoid destructive resource recreation.
- Audit Logging: Records all preflight check results for traceability and troubleshooting.
Use Case: A DevOps engineer setting up a new Azure Terraform project can run this preflight check before their first terraform plan to eliminate the most common first-run errors that would otherwise block deployment.
Quick Start
Run the azure-infra-preflight skill before executing your first terraform plan on a new or existing Azure environment to validate all prerequisites and avoid common deployment errors.