Edit

Bicep diagnostic code - BCP456

This diagnostic occurs when the running Bicep compiler version doesn't satisfy the effective bicep.version requirement for a source file.

Description

The installed Bicep CLI version "{runningVersion}" does not satisfy the version constraint "{constraint}" specified by the "bicep.version" property in the Bicep configuration "{configFile}".

Level

Error in the Bicep CLI. Warning in the Bicep language server.

Solution

Use a compiler version that satisfies the configured requirement. Alternatively, update the requirement after verifying that your files support the compiler you intend to use.

The setting doesn't install or switch compiler versions. Check the compiler used by the tool reporting the diagnostic; the editor and CLI can use different installations.

Examples

The following configuration permits only version 1.2.3:

{
  "bicep": {
    "version": "1.2.3"
  }
}

If the running compiler is 1.2.4, it reports BCP456. The CLI reports an error, while the language server reports a warning. These versions illustrate the comparison, not release availability.

Use a matching compiler, or deliberately change the requirement to a supported version or range.

Each source file uses its own nearest configuration and any explicit inheritance chain. The diagnostic names the declaring configuration, but its source-file location is the start of the evaluated document, not necessarily the configuration property. If a local module declares a different requirement, the running compiler must satisfy that requirement too.

Changing version-compatibility linter levels doesn't change BCP456.

Next steps