How to Convert Bicep to ARM Templates - Step by Step Guide
Input Your Bicep Code
Start with your Bicep file. While Bicep is the modern approach, sometimes you need ARM templates for tooling compatibility or pipeline requirements:
Example: Bicep Code
Clean and readable Bicep syntax:
targetScope = 'resourceGroup'
@description('Storage account name')
param storageAccountName string
param location string = resourceGroup().location
var storageAccountType = 'Standard_LRS'
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
name: storageAccountName
location: location
sku: {
name: storageAccountType
}
kind: 'StorageV2'
properties: {
supportsHttpsTrafficOnly: true
}
}Read the ARM Template
Half a second after you stop typing, the Bicep code is rewritten as ARM template JSON:
Example: Converted ARM Template
Standard ARM template format:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string",
"metadata": {
"description": "Storage account name"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
}
},
"variables": {
"storageAccountType": "Standard_LRS"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-04-01",
"name": "[parameters('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[variables('storageAccountType')]"
},
"kind": "StorageV2",
"properties": {
"supportsHttpsTrafficOnly": true
}
}
]
}Review Generated ARM Template
Review the generated ARM template and verify the conversion:
Deploy Your ARM Template
Download and use your ARM template for deployment:
az deployment group create --template-file azuredeploy.jsonFrequently Asked Questions
Why would I convert Bicep back to ARM templates?
Bicep is the better format to write, but plenty of places still want JSON: an older pipeline task that only takes a template file, a Template Spec or Marketplace offer built from JSON, a policy or blueprint that embeds a template, or a colleague who reviews deployments as ARM JSON. Converting lets you keep writing Bicep and hand over the JSON where it is needed.
What does this converter translate, and what does it leave for me?
It reads params with @description, @allowed, @secure, @minLength/@maxLength and @minValue/@maxValue, vars, resources (including nested child resources and parent:), outputs and targetScope. Symbolic names become resourceId() and reference() calls, string interpolation becomes format(), operators such as == and && become equals() and and(), if (...) becomes a condition, a [for ...] resource loop becomes a copy loop, and the dependsOn entries Bicep adds on its own are added here too. Modules, user-defined types and functions, imports and loadTextContent() are not converted: they show up in a list above the output, so nothing disappears quietly.
Will my numbers and strings come through unchanged?
Yes. Bicep integers are 64-bit, and a value like 8901240544102066246 is written into the JSON with every digit. Bicep has no decimal numbers, so json('14.50') stays json('14.50') in the template, and a quoted '00501' stays a string with its leading zeros. Escapes such as ' and are decoded, and accented letters and emoji are kept as they are.
How is this different from az bicep build?
az bicep build is Microsoft's own compiler and knows every resource type, module and language feature. This page is a quick way to get the JSON without installing anything, and it handles the everyday parts of a Bicep file. The result can differ from the compiler in small ways, such as the order of dependsOn entries. For templates that go into a release pipeline, build them with the Azure CLI as well.
Is my Bicep file uploaded anywhere?
No. The conversion runs in your browser. The file you paste or upload is not sent to our server and nothing is kept, so a reload starts with an empty editor.
Are ARM templates still supported by Microsoft?
Yes. JSON templates are what Azure Resource Manager deploys, and every Bicep file is compiled into one before it is deployed. Microsoft recommends Bicep for new work because it is easier to read and write, but JSON templates keep working with the portal, the Azure CLI and Azure PowerShell.
Can I convert ARM templates to Bicep?
Yes. The ARM to Bicep converter goes the other way, and the Azure CLI has az bicep decompile for the same job.
Related Tools
CloudFormation to Terraform
Convert AWS CloudFormation templates to Terraform HCL configuration
Terraform to CloudFormation
Convert Terraform HCL configurations to AWS CloudFormation templates in YAML or JSON
Azure ARM to Terraform
Convert Azure Resource Manager templates to Terraform HCL with azurerm provider
Ansible to Terraform
Convert Ansible playbooks to Terraform HCL for AWS, Azure, and GCP resources
ARM to Bicep
Convert Azure Resource Manager (ARM) templates to Bicep with modern syntax and improved readability
CloudFormation to Pulumi
Convert AWS CloudFormation templates to Pulumi TypeScript for modern infrastructure as code