| title | BCP152 |
|---|---|
| description | Function <function-name> can't be used as a decorator. |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 10/30/2025 |
This diagnostic occurs when you try to use a Bicep function as a decorator, but the function isn't suitable for that purpose.
Function <function-name> can't be used as a decorator.
Error
Use valid decorators. For a list of parameter decorators, see Decorators.
The following example raises the diagnostic because uniqueString() can't be used as a parameter decorator.
@uniqueString()
param name string You can fix the diagnostic by using the valid decorators.
@description('Provide resource name.')
param name string For more information about Bicep diagnostics, see Bicep core diagnostics.