-
Notifications
You must be signed in to change notification settings - Fork 456
Interoperability Bicep to ARM conversion
Bicep is ready for production use starting with version 0.3. It is supported by Microsoft support plans and has parity with what can be accomplished with ARM Templates.
However, for users who still prefer using ARM templates over Bicep, 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.
NOTE: As Bicep & ARM template files work slightly different (e.g., references as specified differently), the ReadMe we generate out of them using the
/utilities/tools/Set-Module.ps1
utility may look differently. To this end, make sure to regenerate all ReadMEs after you converted the repository from Bicep to ARM. If you don't, the Pester tests in the pipeline may fail when reviewing the ReadMEs.
You can find the script under /utilities/tools/ConvertTo-ARMTemplate.ps1
The script finds all main.bicep
files and converts them to json-based ARM templates by using the following steps:
- Remove existing main.json files from folders where main.bicep files are also present.
- Convert .bicep files to .json
- Remove Bicep metadata from the converted .json files
- Remove .bicep files and folders
- Update pipeline files - Replace .bicep with .json in pipeline files
For details on how to use the function, please refer to the script's local documentation.
Note: The script must be loaded ('dot-sourced') before the function can be invoked.