---
cuppy_hub: azure
cuppy_path: reference/bicep/compile-errors.md
cuppy_section: docs
cuppy_doc: 7AS4-R2KT
cuppy_doc_uuid: df72b339-a0b6-416c-aaf7-800c423f001b
cuppy_permalink: https://cuppy.io/azure/d/7AS4-R2KT
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/azure/docs/reference/bicep/compile-errors
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 63d4a9fe2ef6d17b2fb11d83220e133802cf29f688339b14692087348bfa5e5c
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---


# 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"`.


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 107 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/azure/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
