Last Updated on August 13, 2025 by Arnav Sharma
Terraform is a tool that can be used to manage the infrastructure of a company. Terraform can be used to create, manage, and update infrastructure as code. ARM templates are files that are used to describe the infrastructure that needs to be created. In this article, I will show you how to deploy an ARM template using Terraform.
Option 1: Using the JSON file directly:
I have the ARM template along with the TF file in the same folder:

The first option is to use the file for the template and then pass parameters as shown using the TF var file.

Option 2: Using the JSON template inside the TF file
Using the template content directly within the TF file:

In conclusion, Terraform is an excellent tool for deploying ARM templates. It is easy to use and can be customized to fit your needs, in case the TF module does not exist, or you already have ARM templates.
I help organisations secure their cloud infrastructure and stay ahead of evolving cyber threats. Microsoft MVP and Certified Trainer, author of Mastering Azure Security, and founder of arnav.au — a platform for practical Cloud, Cybersecurity, DevOps and AI content.
Frequently Asked Questions
Terraform allows you to manage and deploy ARM templates as infrastructure as code, enabling you to create, manage, and update your infrastructure in a consistent and reproducible way. This approach makes it easier to version control your infrastructure and customize deployments to fit your specific needs.
Option 1 involves using the ARM template as a separate JSON file in the same folder as your Terraform file and passing parameters through a TF var file. Option 2 involves embedding the ARM template content directly within the Terraform file itself.
When using the JSON file directly as Option 1, you pass parameters using a TF var file. This keeps your template and variables organized separately while allowing Terraform to reference and use them during deployment.
You should use Terraform to deploy ARM templates when a Terraform module doesn't exist for your use case or when you already have ARM templates that you want to reuse. This allows you to leverage your existing infrastructure definitions while benefiting from Terraform's management capabilities.
Yes, you can keep your ARM template JSON file and your Terraform file in the same folder. This organizational approach makes it convenient to manage related files together and simplifies file referencing in your Terraform configuration.