Open verschaevesiebe opened 1 year ago
Related to #10333
And one clarifying question, what is the intention with a general bicepparam file? Is it a superset of all parameters that might be used with any number of given bicep files? Is that bicepparam file ever used for the actual deployment or only for authoring-time validation?
Hi Alex,
Glad you're asking some more context. Below an example of what we're trying to do. We are basicly having a folder for each API deployment. As an API deployment contains a _main.bicep with policies, endpoints and openAPI's defined we still need general keyvault and general parameters.
How we currently deploy is that in DevOps pipeline you can do a selection of which specific API's you can deploy during a specific run.
Below is a screenshot of the bicep setup (reverted back to JSON params). You can see 3 environment parameter files that are reused for each folders _main.bicep
There is a scenario where you might want to share a Bicep Param file between multiple templates
1) Some of the different things from the environment have to be deployed at different scopes 1) So you use the file to do a subscription based deployment and also a Resource Group based Deployment 1) Some of the resources in the document require an Owner permissions to deploy, such as Role Assignments 1) so you do two separate deployments with two separate service principals
So you have 1 parameter file, used across multiple deployment Templates.
Bicep version v0.18.4.
Describe the bug During a deployment to Azure we're encountering some issues. We have created a framework structure that has multiple folders which contain a _main.bicep file per folder. We're running a loop in the DevOps pipeline that actually runs through this folder and takes that _main.bicep file and adds the general parameter file (previously json param).
Every _main.bicep accepts the same parameters that's why we also have a general param file. Upon the switch to .bicepparam files there's a requirement to define the using statement at the top. I understand the use of it and that it makes sure intellisense can work within visual studio code.
However, i don't understand why the using context of the param file is being used during a deployment. This requires us to create a specific param file per _main.bicep file. (per folder).
The bicepparam file now basicly becomes master over the bicep template itself while i would expect the behavior to be the other way around where the bicep file would not care at what using statement is in the bicepparam and just takes the parameters like it did with the json file.
Error caused on DevOps
ERROR: Bicep file /home/vsts/work/1/s/Bicep/Apis/API - Dossier/_main.bicep provided with --bicep-file option doesn't match the Bicep file /home/vsts/work/1/s/Bicep/_main.bicep referenced by the using declaration in the parameters file
For additional information or a short demo of this I'm always reachable either through email or in the bicep community calls when i'm attending. Thanks