| title | BCP226 |
|---|---|
| description | Expected at least one diagnostic code at this location. Valid format is `#disable-next-line diagnosticCode1 diagnosticCode2 ...` |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 01/15/2026 |
Bicep diagnostic code BCP226 occurs when a Bicep file contains a #disable-next-line directive but doesn't specify any diagnostic codes after the directive.
The #disable-next-line directive requires at least one diagnostic code to indicate which compiler diagnostics to suppress for the following line. If you use the directive without any codes, the compiler can't determine which diagnostics to disable and reports BCP226.
Expected at least one diagnostic code at this location. Valid format is #disable-next-line diagnosticCode1 diagnosticCode2 ...
Error
Add at least one diagnostic code.
The following example raises the diagnostic because it doesn't specify any diagnostic codes after the directive.
#disable-next-line
resource stg 'Microsoft.Storage/storageAccounts@2025-06-01' = {
name: 'mystorage'
}You can fix the diagnostic by adding one or more diagnostic codes. List multiple codes separated by spaces.
#disable-next-line BCP035
resource stg 'Microsoft.Storage/storageAccounts@2025-06-01' = {
name: 'mystorage'
}For more information about Bicep diagnostics, see Bicep core diagnostics.