Bicep diagnostic code - BCP127

This diagnostic occurs when you specify an invalid resource decorator.

Description

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

Level

Error

Solutions

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

Examples

The following example raises the diagnostic because @export() is not a valid resource decorator.

@export()
resource store 'Microsoft.Storage/storageAccounts@2023-05-01' existing = {
  name: uniqueString(resourceGroup().id)
}

The valid resource decorators are @description() and @batchSize().

Next steps

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