Skip to content
Latchkey

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.bicep

Keep the Azure CLI and Bicep current

Upgrade both so deploys use a compatible compiler version.

Terminal
az bicep upgrade
az version

How to prevent it

  • Add az bicep install to 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →