-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BICEP BCP079: This expression is referencing its own declaration, which is not allowed. #5313
Comments
I don't believe the code you are sharing is the source of the error. Can you share the full ARM template? |
Can't share the full template. I'll try and create a minimal template. Will close this one until I can create a minimal repro. |
The issue was just that "description" was used as a parameter name. Once it is identified as a parameter name, it conflicts with the built-in description attribute. The error message wasn't so clear initially since it affected every @description('mydesc') line. I would suggest that a list of reserved words or mention that description is a reserved word and cannot be used as a parameter could be shown or provide support for both a description parameter and description attribute. I would think name and description should be allowed parameter names and there should be no constraints as to what a parameter is called? |
I'm also having the same issue when I decompile the below ARM template.... {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"azureFirewalls_afw_we_adev_play_name": {
"defaultValue": "afw-we-adev-play",
"type": "String"
},
"publicIPAddresses_pip_we_adev_afw_externalid": {
"defaultValue": "/subscriptions/bb33c192-ceb7/resourceGroups/rg-manju-play/providers/Microsoft.Network/publicIPAddresses/pip-we-adev-afw",
"type": "String"
},
"virtualNetworks_vneweadev1play_externalid": {
"defaultValue": "/subscriptions/bb33c192-ceb7/resourceGroups/rg-manju-play/providers/Microsoft.Network/virtualNetworks/vneweadev1play",
"type": "String"
}
},
"resources": [
{
"apiVersion": "2022-05-01",
"location": "westeurope",
"name": "[parameters('azureFirewalls_afw_we_adev_play_name')]",
"properties": {
"additionalProperties": {},
"applicationRuleCollections": [],
"ipConfigurations": [
{
"id": "[concat(resourceId('Microsoft.Network/azureFirewalls', parameters('azureFirewalls_afw_we_adev_play_name')), '/azureFirewallIpConfigurations/pip-we-adev-afw')]",
"name": "pip-we-adev-afw",
"properties": {
"publicIPAddress": {
"id": "[parameters('publicIPAddresses_pip_we_adev_afw_externalid')]"
},
"subnet": {
"id": "[concat(parameters('virtualNetworks_vneweadev1play_externalid'), '/subnets/AzureFirewallSubnet')]"
}
}
}
],
"natRuleCollections": [],
"networkRuleCollections": [],
"sku": {
"name": "AZFW_VNet",
"tier": "Standard"
},
"threatIntelMode": "Alert"
},
"type": "Microsoft.Network/azureFirewalls"
}
],
"variables": {}
} |
Bicep version
Bicep CLI version 0.4.1008 (223b8d2)
Describe the bug
When decompiling an ARM template, I see a number of warnings in output.
BICEP BCP079: This expression is referencing its own declaration, which is not allowed.
This warning is confusing and not sure how to act on it other than deleting the description.
I would expect that Bicep understands the @description metadata tag or has some way of creating a custom attribute for this.
To Reproduce
Each line has a description.
Additional context
#1665 may relate.
The text was updated successfully, but these errors were encountered: