You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the new .bicepparam files we can establish the relation with the template with the "using" statement. This improves development and editing experience.
However, when the statement is left out, and the the parameter file is linked to the template by deploying with the Azure CLI, it will throw an error stating that it is obligatory:
"Error BCP261: A using declaration must be present in this parameters file"
To Reproduce
Steps to reproduce the behavior:
I have a simple main.bicep to deploy a key vault, and a keyvault.bicepparam containing:
(ins)$ az deployment group validate -f main.bicep -p keyvault.bicepparam -g coffee
/Users/mischa/Repos/github.com/mischavandenburg/lab/bicep/keyvault-parameters/keyvault.bicepparam(1,1) : Error BCP261: A using declaration must be present in this parameters file.
I've also tried this with what-if and az deployment group create, and I get the same errors.
Additional context
It seems from #399 that the original intention of the "using" statement was for validation only, based on the heading "Linking to a Bicep file for better validation"
Having this relationship established inside a static textfile is acceptable during development and gives the editor great capabilities in validation. However, it becomes very cumbersome and redundant during deployments especially when the param-file is in a workload repo and the template-file is in a generic/utility/library repo. During deployments this relationship is already clear because of the --template-file keyvault.bicep --parameters keyvault.bicepparam cli arguments. Having a static path included in the param file means all parameter files should be adjusted when the location of 1 template file is changed which violates the "seperation of concerns" principle.
If the general idea is to remove the --template-file parameter when using a .bicepparam file, I could understand the choice of making "using x.bicep" required, but for the above mentioned practical reason of not wanting a static link in many similar paramfiles, I would greatly prefer to have the "using" statement is optional.
Otherwise I am super stoked about the new .bicepparam files and they are great improvement to my life as a Cloud Engineer!
I'm also willing to pick up this issue myself if someone would be willing to guide me a bit. I can code in Go & Python but C# is outside my current skillset unfortunately. I would love to contribute.
The text was updated successfully, but these errors were encountered:
Bicep version
Bicep CLI version 0.18.4 (1620479)
Describe the bug
When using the new .bicepparam files we can establish the relation with the template with the "using" statement. This improves development and editing experience.
However, when the statement is left out, and the the parameter file is linked to the template by deploying with the Azure CLI, it will throw an error stating that it is obligatory:
"Error BCP261: A using declaration must be present in this parameters file"
To Reproduce
Steps to reproduce the behavior:
I have a simple main.bicep to deploy a key vault, and a keyvault.bicepparam containing:
I validate it using the Azure CLI:
az deployment group validate -f main.bicep -p keyvault.bicepparam -g coffee
Validating this deployment succeeds.
However, when I use the parameter file as follows, I get an error:
I've also tried this with what-if and
az deployment group create
, and I get the same errors.Additional context
It seems from #399 that the original intention of the "using" statement was for validation only, based on the heading "Linking to a Bicep file for better validation"
Having this relationship established inside a static textfile is acceptable during development and gives the editor great capabilities in validation. However, it becomes very cumbersome and redundant during deployments especially when the param-file is in a workload repo and the template-file is in a generic/utility/library repo. During deployments this relationship is already clear because of the
--template-file keyvault.bicep --parameters keyvault.bicepparam
cli arguments. Having a static path included in the param file means all parameter files should be adjusted when the location of 1 template file is changed which violates the "seperation of concerns" principle.If the general idea is to remove the
--template-file
parameter when using a .bicepparam file, I could understand the choice of making "using x.bicep" required, but for the above mentioned practical reason of not wanting a static link in many similar paramfiles, I would greatly prefer to have the "using" statement is optional.Otherwise I am super stoked about the new .bicepparam files and they are great improvement to my life as a Cloud Engineer!
I'm also willing to pick up this issue myself if someone would be willing to guide me a bit. I can code in Go & Python but C# is outside my current skillset unfortunately. I would love to contribute.
The text was updated successfully, but these errors were encountered: