Skip to content
Latchkey

Azure Bicep "Error BCP018: expected ... character" in CI

BCP018 is a Bicep parser error: it expected a specific token (a brace, colon, or keyword) at a location and found something else. The file fails to compile, so no deployment is attempted.

What this error means

az deployment or bicep build fails with "Error BCP018: Expected the \"}\" character at this location" (or another character), pointing at a line and column.

Bicep
main.bicep(24,3) : Error BCP018: Expected the "}" character at this location.

Common causes

A missing or extra delimiter

An unclosed object, a missing colon in a property, or a stray comma breaks the grammar at the reported line.

A typo in a keyword or declaration

A misspelled resource/param keyword or malformed decorator confuses the parser into expecting a different token.

How to fix it

Build locally to find the line

  1. Run az bicep build --file main.bicep (or bicep build) to reproduce the exact line and column.
  2. Fix the missing brace, colon, or keyword at that location.
  3. Rebuild until BCP018 clears, then deploy.
Terminal
az bicep build --file main.bicep

Lint Bicep in CI before deploy

Add a build/lint step so syntax errors fail fast in a pre-deploy job rather than during the Azure deployment.

.github/workflows/ci.yml
- run: az bicep build --file main.bicep

How to prevent it

  • Run az bicep build as a CI lint step before deploy.
  • Use the Bicep editor extension to catch BCP errors while editing.
  • Keep modules small so syntax errors are easy to locate.

Frequently asked questions

What causes ""Error BCP018""?
An unclosed object, a missing colon in a property, or a stray comma breaks the grammar at the reported line.
How do I fix "Error BCP018"?
Build locally to find the line

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card