Azure Bicep "Bicep CLI not found / not installed" in CI
The Azure CLI ships Bicep as a separate component. When a runner has az but not the Bicep CLI, any command that compiles a .bicep file fails and tells you to install it.
What this error means
A deploy step fails with "Bicep CLI not found. Install it now by running \"az bicep install\"" or "\"bicep\" is not recognized" on the runner.
Bicep
Bicep CLI not found. Install it now by running "az bicep install" and rerun
the command. Error: [Errno 2] No such file or directory: 'bicep'Common causes
The Bicep component was never installed
A fresh runner image has the Azure CLI but not the Bicep CLI, which is a separate download.
A custom image trimmed the Bicep binary
A slim or self-managed image removed bicep to save space, so az cannot compile templates.
How to fix it
Install Bicep before deploy
Run az bicep install (or upgrade) as a setup step so the compiler is present.
.github/workflows/ci.yml
- run: az bicep install
- run: az deployment group create -g my-rg --template-file main.bicepKeep the Azure CLI and Bicep current
Upgrade both so deploys use a compatible compiler version.
Terminal
az bicep upgrade
az versionHow to prevent it
- Add
az bicep installto the setup phase of the job. - Bake the Bicep CLI into custom runner images.
- Pin and verify the Bicep version your templates need.
Related guides
Azure Bicep "Error BCP018: expected ... character" in CIFix Azure Bicep "Error BCP018: Expected the ... character at this location" in CI - the .bicep file has a syn…
Azure Bicep "Deployment failed ... InvalidTemplate" in CIFix Azure "Deployment failed ... InvalidTemplate" in CI - the ARM template compiled from Bicep was rejected b…
Azure Bicep "RoleAssignmentUpdateNotPermitted" in CIFix Azure "RoleAssignmentUpdateNotPermitted" in CI - a redeploy tries to change an existing role assignment,…