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
Is your feature request related to a problem? Please describe.
I like the idea of passing in objects as parameters into my Bicep, I feel like it can make the parameter files nicer to write and can give the ability to logically separate the parameter file up into sections.
But the problem that I get with this is that whilst the individual parameters can be set to be required / have required values, when passing in an object there seems to be very limited validation on what is passed in.
In the above example, the Bicep file won't run without me passing in sql_ServerName, sql_subscriptionID and sql_resourceGroup.
But I could pass in any object, even if the properties are wrong and the Bicep will at least try to run (and then likely fail down the line)
Ideally, I'd like for there to be a validation on the child properties of an object that gets passed in. This could also be very helpful for tagging resources, as in when you pass in a parameter like:
This is just my thoughts from the way that I'm used to working. If anyone does have a suggestion on how I should be using Bicep better to achieve the above then do let me know! Very interested to learn more :)
Let me know if you have any questions.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I like the idea of passing in objects as parameters into my Bicep, I feel like it can make the parameter files nicer to write and can give the ability to logically separate the parameter file up into sections.
For example, instead of:
I can instead do:
But the problem that I get with this is that whilst the individual parameters can be set to be required / have required values, when passing in an object there seems to be very limited validation on what is passed in.
In the above example, the Bicep file won't run without me passing in
sql_ServerName
,sql_subscriptionID
andsql_resourceGroup
.But I could pass in any object, even if the properties are wrong and the Bicep will at least try to run (and then likely fail down the line)
Ideally, I'd like for there to be a validation on the child properties of an object that gets passed in. This could also be very helpful for tagging resources, as in when you pass in a parameter like:
Describe the solution you'd like
Add a new decorator for object parameters which evaluates whether an object has all of its "Required Properties"
for example:
This would throw an error whenever an object is passed in without the required properties.
E.g. this would pass:
This would fail:
A further improvement could be made (though this isn't a priority for me) by then allowing decorators on those properties, such as:
This is just my thoughts from the way that I'm used to working. If anyone does have a suggestion on how I should be using Bicep better to achieve the above then do let me know! Very interested to learn more :)
Let me know if you have any questions.
The text was updated successfully, but these errors were encountered: