Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 891 Bytes

File metadata and controls

38 lines (24 loc) · 891 Bytes
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

Bicep diagnostic code - BCP126

This diagnostic occurs when you specify an invalid variable decorator.

Description

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

Level

Error

Solutions

Use the valid decorators for variable declarations. For more information, see Decorators.

Examples

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().

Next steps

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