Decompiling ARM templates into Bicep
Now that you understand how to compile your Bicep files and can troubleshoot any possible errors or warnings, it is time to show you how to migrate your existing templates into Bicep. You have already seen the Azure Bicep Playground and its decompile option in Chapter 3, Authoring Experience, so I will not cover it again here. Instead, we will use the CLI to decompile an ARM template into Bicep.
All you need to do is use one of the following methods.
Using the Azure CLI
To use the Azure CLI to decompile an ARM template, simply run the following command:
az bicep decompile --file main.json
Once the command has been completed, you should see the resulting Bicep file in the same location:
Now you have the Bicep file generated with the same name, and you can use it for future cases.
Using the Bicep CLI
You can use the Bicep CLI...