Open jongio opened 1 year ago
We should also do this for simplified init too - @rajeshkamal5050 @weikanglim @ellismg
There are some todo-templates which are not compatible with .bicepparams @jongio
For example, the SQL Server templates b/c the template uses azd to auto-generate a secrets like: https://github.com/Azure-Samples/todo-csharp-sql/blob/main/infra/main.parameters.json#L18
We don't have an alternative on bicepparam world for extending/controlling parameters the same way we do on parameters.json
@jongio Any ideas about Victor's comment?
Victor Is something stopping us from implementing that in bicepparam?
Victor Is something stopping us from implementing that in bicepparam?
I little bit @jongio. The bicep-compilation flow changes; for example, if there's a parameter foo
(with no default value) defined in main.bicep
and you don't set a mapping to assign a value for it in main.bicepparam
, bicep would return an error while compiling, like:
Before bicepparam
flow, bicep would only care about compiling a template (ignoring the inputs for the parameter definitions). That allows azd
to take control after bicep compilation to inspect the parameter definitions and ensure getting a value for each of them.
With bicepparam
, we need to think and define some strategy for azd to help getting the input values... Some alternatives are:
parameters.json
together with bicepparam
. In this case, the parameters.json
would be azd-specific. Azd would first combine the bicepparam and the parameters.json into one single bicepparam for deployment.@ellismg , what do you think,... do you like any of these proposals? or do you have some other idea?
We could also work with bicep team to update bicep to allow us to do what we need to do.
@rajeshkamal5050 Can you help contact the Bicep team
to develop function auto-generate secrets
(like function in json)?
@rajeshkamal5050 Can you help contact the
Bicep team
to develop functionauto-generate secrets
(like function in json)?
@vhvb1989 can you take a look and file specific asks on Bicep team w.r.t secretOrRandomPassword
or such similar functions POV. Moving it to Backlog.
Note:
Rather than add any azd
-specific functionality that would require more implementation from both teams, why not a flag you can pass bicep
that just translate what they already support to something you already support:
readEnvironmentVariable('FOO')
-> ${FOO}
readEnvironmentVarialbe('BAR', 'baz')
-> ${BAR=baz}
Adding a flag to bicep
that would do this is probably more palatable than adding azd
-specific functionality and its certainly more portable. Then all azd
has to do is pass this new flag and you get back a JSON stream that you already support.
BTW: no need to save this to a file on disk - nor the main.bicep
file. Maybe it was added later, but bicep build
and bicep build-params
has a --stdout
flag so you can just unmarshal from os.Stdout
and not have to worry about cleaning up temp file copies. /cc @ellismg @vhvb1989
Bicep and azd now support bicepparam. Let's get the templates we own updated to use bicepparam.
https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/parameter-files?tabs=Bicep