Azure has taken another leap forward in supporting Infrastructure as Code (IaC) practitioners by introducing a much-anticipated feature: Export Template to Terraform. This new capability allows users to export existing Azure resources into Terraform HCL (HashiCorp Configuration Language) — marking a significant evolution from the traditional ARM (Azure Resource Manager) templates.
Whether you’re a DevOps engineer, a cloud architect, or someone starting out in cloud automation, this feature simplifies the transition from portal-based configurations to fully codified and repeatable infrastructure.
🔍 What Is “Export Template to Terraform”?
Previously, Azure allowed exporting resources as ARM templates, a JSON-based format native to Azure. While powerful, many organizations have standardized on Terraform due to its cloud-agnostic capabilities and cleaner syntax.
The new “Export Template to Terraform” feature lets you:
-
Convert existing Azure resources into Terraform code
-
Export directly from the Azure Portal
-
Accelerate your infrastructure-as-code adoption
-
Reduce manual writing of Terraform configurations
🚀 Where to Find It
As of mid-2025, the feature is available in preview and can be accessed directly from:
-
Azure Portal
Go to a resource group > “Export Template” > Choose Terraform (Preview) tab. -
Azure Resource Manager (ARM)
Internally, Azure performs a mapping from ARM to HCL using the new export engine behind the scenes.
💡 Note: Not all resources are currently supported — Microsoft is rolling out support incrementally based on resource types and maturity.
Example:
🎯 Why This Matters
The Export to Terraform feature is a game-changer because:
-
✅ Speeds up migration from manual or ARM-managed resources to Terraform
-
✅ Improves repeatability of infrastructure deployments
-
✅ Reduces human error in writing Terraform code from scratch
-
✅ Encourages IaC-first culture across organizations
⚠️ Limitations to Know (Preview)
While powerful, there are a few things to watch out for in the preview version:
-
❌ Not all Azure resources are supported yet (e.g., some advanced networking features)
-
⚠️ Exported code may require manual refactoring for modules or best practices
-
⚠️ State is not generated — users must import resources manually using
terraform import
-
🧪 Some Terraform configurations may use deprecated arguments — review is recommended
🛠 Best Practices
To make the most out of this feature:
-
Use exported templates as a starting point, not the final solution
-
Validate resources against the Terraform Azure Provider documentation
-
Adopt Terraform modules to organize and scale your code
-
Integrate with CI/CD pipelines using GitHub Actions or Azure DevOps
🌐 Future Roadmap
Microsoft has announced its commitment to expanding this feature by:
-
Supporting more resource types
-
Improving conversion fidelity and naming conventions
-
Enabling CLI/PowerShell support for export
-
Integrating into Azure Deployment Stacks and Bicep-to-Terraform bridges
✅ Summary
The “Export Template to Terraform” feature is a vital addition to Azure’s infrastructure-as-code toolkit. It helps bridge the gap between GUI-based Azure resources and codified, scalable Terraform-managed environments.
As with any preview feature, proceed with awareness — but it’s safe to say that Azure is betting big on Terraform, and this move affirms that direction.