Compiling Bicep files
In this section, you will learn how to compile your Bicep files. The simplest way in which to compile your Bicep file is by using the Bicep CLI. By now, you should have it installed and ready to use.
Compiling a Bicep file using the Bicep CLI
The Bicep CLI has a build
command that compiles a Bicep file and produces an ARM template. Create a new empty file and rename it main.bicep
. You can also use the following command in both Linux and macOS:
ECHO >> main.bicep
Following this, open a terminal where the file is located and run the following:
bicep build main.bicep
This will produce the following output inside a file called main.json
:
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { ...