Loading ARM to Terraform Converter...

How to Convert Azure ARM Templates to Terraform

Step 1

Input Your Azure ARM Template

Start by providing your Azure Resource Manager template. Whether you're migrating from ARM to Terraform or modernizing your Azure Infrastructure as Code:

•
Paste directly: Copy your ARM template (JSON or YAML) and paste it into the input editor
•
Upload files: Click "Upload" to open a .json or .template file
•
Try the sample: Click "Sample" to load a small template with a virtual network, a storage account and an output
Step 2

Automatic Conversion Process

The converter reads your template and writes Terraform HCL using the azurerm provider:

•
Resource mapping: 29 common Azure resource types become azurerm resource blocks; other types are skipped and named in a note at the top of the output
•
ARM functions: parameters() becomes var., variables() becomes local., and resourceId(), concat() and format() are rewritten where they can be; other expressions are kept as text
•
Parameters → Variables: ARM parameters become Terraform variables with a type, description and default, and ARM variables become a locals block
•
Outputs preserved: ARM outputs are converted to Terraform outputs
•
Provider setup: Generates terraform required_providers block and azurerm provider configuration
Step 3

Review Generated Terraform Code

Review the generated main.tf configuration. Treat it as a first draft and check these points before you run it:

•
Property names: ARM properties are copied with snake_case names. Rename them to the azurerm arguments and add resource_group_name where the resource needs it
•
Location: [parameters('location')] becomes var.location, and a default of [resourceGroup().location] becomes a variable you set when you run Terraform
•
Tags preserved: Resource tags are copied with their original key names
Step 4

Download and Deploy with Terraform

Deploy your Azure infrastructure with Terraform:

•
Download: Save main.tf to your project directory
•
Initialize: Run terraform init to download the azurerm provider
•
Authenticate: Run az login to authenticate with Azure
•
Apply: Run terraform apply to provision Azure resources

Frequently Asked Questions

Which Azure resource types become Terraform resources?

A fixed list of 29 common types, including virtual machines and scale sets, managed disks, storage accounts and blob containers, virtual networks, network interfaces, public IPs, network security groups, load balancers, application gateways, App Service plans and sites, SQL, PostgreSQL and MySQL servers, Cosmos DB, AKS, container registries and container groups, Application Insights, Log Analytics, managed identities, Key Vault and resource groups. Any other type is skipped, and a note at the top of the output names it.

Are the resource properties matched to the azurerm arguments?

No. Every key from properties, plus sku, kind and similar top-level keys, is copied into the resource block with its name in snake_case, so addressSpace becomes address_space. The azurerm provider often uses different names and nested blocks, and most resources also need resource_group_name, so expect to rename and reshape some of them. terraform validate shows you which ones.

Which ARM template functions are translated?

parameters('x') becomes var.x, variables('x') becomes local.x, resourceGroup().location and resourceGroup().name become variables you set, and resourceId() pointing at a resource in the same template becomes a reference like azurerm_virtual_network.main.id. concat() and format() with text in them become string interpolation, and toLower, toUpper and length become lower, upper and length. Anything else, such as reference(), uniqueString() or if(), is kept as quoted text and listed in a note so you can replace it by hand.

What happens to dependsOn, conditions and copy loops?

dependsOn entries that point at a resource in the template become depends_on references. Conditions, copy loops and child resources nested inside another resource are not converted; they are left as comments in the output so you can rewrite them with count or for_each.

Will long IDs, prices or text with quotes change?

No. Numbers are written with the digits you typed, so 8901240544102066246 and 14.50 come out exactly as they were, and the string "00501" stays a string. Quotes, backslashes and line breaks are escaped, and a literal ${ or %{ is written as $${ or %%{ so Terraform does not try to interpolate it.

Is my ARM template uploaded anywhere?

No. The conversion runs in your browser, nothing is sent to a server and nothing is kept, so a reload starts with an empty editor.

What about Azure Bicep files?

Compile the Bicep file to an ARM template first with az bicep build, then paste the resulting JSON here.