| title | BCP126 |
|---|---|
| description | Function <function-name> can't be used as a variable decorator. |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 10/30/2025 |
This diagnostic occurs when you specify an invalid variable decorator.
Function <function-name> can't be used as a variable decorator.
Error
Use the valid decorators for variable declarations. For more information, see Decorators.
The following example raises the diagnostic because @minLength() is not a valid variable decorator.
@minLength()
var name = uniqueString(resourceGroup().id)The valid variable decorators are @description() and @export().
For more information about Bicep diagnostics, see Bicep core diagnostics.