| title | BCP127 |
|---|---|
| description | Function <function-name> can't be used as a resource decorator. |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 10/30/2025 |
This diagnostic occurs when you specify an invalid resource decorator.
Function <function-name> can't be used as a resource decorator.
Error
Use the valid decorators for resource declarations. For more information, see Decorators.
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().
For more information about Bicep diagnostics, see Bicep core diagnostics.