Bicep error code - BCP152

This error occurs when you try to use a Bicep function as a decorator, but the function isn't suitable for that purpose.

Error description

Function <function-name> can't be used as a decorator.

Solutions

Use valid decorators. For a list of parameter decorators, see Decorators.

Examples

The following example raises the error because uniqueString() can't be used as a parameter decorator.

@uniqueString()
param name string 

You can fix the error by using the valid decorators.

@description('Provide resource name.')
param name string 

Next steps

For more information about Bicep error and warning codes, see Bicep core diagnostics.