| name | aztfexport |
| description | Use when exporting existing Azure resources to Terraform using aztfexport. Triggers on aztfexport, Azure import to Terraform, export Azure resource, bring Azure under Terraform management, reverse-engineer Azure infrastructure, bootstrap IaC from live Azure resources. Covers resource, resource-group, and query modes. |
aztfexport — Export Azure Resources to Terraform
Overview
aztfexport is a Microsoft tool that exports existing Azure resources into Terraform HCL + state. It reverse-engineers live Azure infrastructure into Terraform configurations. Use this for Azure-only workflows or Terraform versions before 1.14's native terraform query.
When to Use
- Export a single Azure resource to Terraform →
aztfexport resource
- Export an entire resource group →
aztfexport resource-group
- Export resources matching an Azure Resource Graph query →
aztfexport query
- Bootstrapping IaC from existing Azure infrastructure
Use terraform-search-import skill instead when: Terraform >= 1.14 with terraform query + bulk import (multi-cloud, not Azure-specific).
Prerequisites
- aztfexport installed:
brew install aztfexport (macOS) or see GitHub releases
- Azure CLI authenticated:
az login + correct subscription selected
- Architecture check (critical on macOS):
file $(which aztfexport)
uname -m
If mismatch (e.g., x86_64 binary on arm64 Mac), reinstall the correct architecture version.