Skip to content

Interoperability Bicep to ARM conversion

CARMLPipelinePrincipal edited this page Mar 5, 2022 · 8 revisions

Bicep is a relatively new Domain-specific language (DSL) and, at the time of writing, not yet in version 1.0.0. For this reason, some people may want to wait for Bicep's General Availability and prefer to use ARM/JSON for the time being.

For these scenarios, the CARML library provides a script that uses the Bicep Toolkit translator/compiler to support the conversion of CARML Bicep modules to ARM/JSON Templates. This page documents the conversion utility and how to use it.


Navigation


Location

You can find the script under /utilities/tools/ConvertTo-ARMTemplate.ps1

How it works

The script finds all deploy.bicep files and converts them to json-based ARM templates by using the following steps:

  1. Remove existing deploy.json files from folders where deploy.bicep files are also present.
  2. Convert .bicep files to .json
  3. Remove bicep metadata from the coverted .json files
  4. Remove .bicep files and folders
  5. Update pipeline files - Replace .bicep with .json in pipeline files

How to use it

For details on how to use the function please refer to the script's local documentation.

Note: The script must be loaded before the function can be invoked

Clone this wiki locally