Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.08 KB

File metadata and controls

45 lines (29 loc) · 1.08 KB
title BCP124
description The decorator <decorator-name> can only be attached to targets of type <data-type>, but the target has type <data-type>.
ms.topic reference
ms.custom devx-track-bicep
ms.date 10/30/2025

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.