Επεξεργασία

Κοινή χρήση μέσω


Bicep diagnostic code - BCP124

This diagnostic occurs when you specify a decorator that isn't supported by the type of the syntax being decorated.

Description

The decorator <decorator-name> can only be attached to targets of type <data-type>, but the target has type <data-type>.

Level

Error

Solutions

Use the valid decorators based on the data types.

Examples

The following example raises the diagnostic because @maxValue() is for the integer data type, not for the string data type.

@maxValue(3)
param name string 

You can fix the diagnostic by providing the correct decorator for the data type:

@maxLength(3)
param name string 

For a list of decorators, see Decorators.

Next steps

For more information about Bicep diagnostics, see Bicep core diagnostics.