Bicep compiler and linter messages (BCP codes)
Look up a message from bicep build or the linter — BCP035, 036, 037, 053, 073 (type mismatches that are only warnings), BCP081 (no types for that API version), BCP057, BCP120 (value needed at deployment start), BCP134 and 135 (scope), BCP333, string and syntax errors BCP004 and 064, and the linter rules agents trip (secure-parameter-default, outputs-should-not-contain-secrets, no-hardcoded-env-urls, no-unused-params, no-unnecessary-dependson) — with the Bicep CLI 0.48.1 wording, cause and fix.
markdownreferencev17AS4-R2KTstage: buildtrust: officialservice: bicepinterface: iacBCP035BCP036BCP037BCP053BCP057BCP064BCP004BCP073BCP081BCP120BCP134BCP135BCP139BCP165BCP333BCP318BCP321does not have types availablerequires a value that can be calculated at the start of the deploymentis not valid for this moduleis not valid for this resource typesecure-parameter-defaultoutputs-should-not-contain-secretsno-hardcoded-env-urlsno-unused-paramsno-unnecessary-dependsonuse-recent-api-versionsbicepconfig.json linter
Bicep compiler and linter messages
Errors stop the build; warnings don't — and the type checks are warnings. A file with BCP035, BCP036 or BCP037 compiles to JSON and deploys, then Azure refuses the resource. Treat type warnings as errors. Each message ends with a link, https://aka.ms/bicep/core-diagnostics#BCPnnn (or …/linter-diagnostics#<rule>). The wording below is from Bicep CLI 0.48.1; Microsoft's page writes some of it with contractions ("isn't" for "is not").
Types and properties (warnings)
| Message | Cause → fix | Check | |
|---|---|---|---|
Warning BCP035: The specified "resource" declaration is missing the following required properties: "sku". | A required property is missing for that type and API version | The resource's reference page for that API version | |
| `Warning BCP036: The property "<p>" expected a value of type "bool \ | null" but the provided value is of type "'yes'".` | Wrong type: a string for a bool, an object for an array | Fix the literal or the parameter's type |
Warning BCP037: The property "<p>" is not allowed on objects of type "<Type>". Permissible properties include … | Misspelt or misplaced property (often under properties: vs top level) | The permissible list in the message | |
Warning BCP053: The type "<Type>" does not contain property "<p>". Available properties include … | Reading an output property that doesn't exist | The available list in the message | |
Warning BCP073: The property "id" is read-only. Expressions cannot be assigned to read-only properties. | Setting a read-only property; remove it | — | |
Warning BCP081: Resource type "<type>@<version>" does not have types available. Bicep is unable to validate resource properties prior to deployment… | The API version is mistyped, or newer than this Bicep build's type library (storage 2026-09-01 with 0.48.1). Nothing in that resource is checked. Use a version Bicep knows | Build a one-resource file with candidate versions until BCP081 disappears | |
Warning BCP333: The provided value (whose length will always be less than or equal to 1) is too short … (and BCP334) | A literal fails the type's length limits, for example a storage name under 3 characters | The name rules for that type | |
Warning BCP318 / BCP321 | A value that may be null at deployment start. Use the safe-access operator .? with a default (??), or ! if you know it isn't null | — |
Names, scopes and timing (errors)
| Message | Cause → fix | Check |
|---|---|---|
Error BCP057: The name "<n>" does not exist in the current context. | Undeclared symbol or a typo | — |
Error BCP120: This expression is being used in an assignment to the "name" property of the "<type>" type, which requires a value that can be calculated at the start of the deployment. Properties of <sym> which can be calculated at the start include "apiVersion", "id", "name", "type". | name, scope, parent and loop counts can't depend on runtime values such as another resource's endpoints. Derive them from parameters or uniqueString() | The properties listed in the message |
Error BCP135: Scope "<s>" is not valid for this resource type. Permitted scopes: "<p>". | The resource can't be deployed at the file's targetScope (a storage account in a subscription file, a resource group in a group file). Move it into a module with scope:, or change targetScope | targetScope at the top of the file |
Error BCP134: Scope "<s>" is not valid for this module. Permitted scopes: "<p>". | The module's own targetScope doesn't accept that scope: value | The module file's targetScope |
BCP139, BCP165 | A resource's (computed) scope differs from the file's: deploy it through a module | — |
Error BCP004: The string at this location is not terminated due to an unexpected new line character.; Error BCP064: Found unexpected tokens in interpolated expression. | Broken quoting or ${…} interpolation | The line and column in parentheses |
Linter rules agents trip
| Rule (warning) | Cause → fix |
|---|---|
secure-parameter-default: Secure parameters should not have hardcoded defaults (except for empty or newGuid()). | Remove the default from the @secure() parameter; pass it at deploy time or with getSecret |
outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: … | Outputs are stored in deployment history in plain text. Don't output keys or connection strings: output the resource ID and read secrets at runtime |
no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function… | Replace management.azure.com and similar with environment().resourceManager and friends |
no-unused-params, no-unused-vars, no-unused-existing-resources | Remove them |
no-unnecessary-dependson | Drop dependsOn already implied by a symbolic reference; unneeded dependencies slow deployments and can create cycles |
use-recent-api-versions | Off by default; when enabled it flags API versions older than two years |
Linter rule levels are set per repository in bicepconfig.json (analyzers.core.rules.<rule>.level: off, info, warning, error). Microsoft lists the type codes as "Error/Warning": against resource types they're warnings because a type definition can be inaccurate (the message asks you to report it). So fail your CI on them yourself: bicep build main.bicep 2>&1 | grep -E 'BCP0(35|36|37|53|73|81)' && exit 1.
When none of these fits
Open the link at the end of the message. Then confirm the API version exists for the type: az provider show --namespace <ns> --query "resourceTypes[?resourceType=='<type>'].apiVersions".