-
Notifications
You must be signed in to change notification settings - Fork 798
Description
Is your feature request related to a problem? Please describe.
As you may be aware, many resource have properties / payloads that can differ vastly depending on the value of one property (which is similar to our discriminated types).
For example
- Microsoft.Web/sites/config: Has a completely different structure, depending on the chosen value for 'name'
- Microsoft.Insights/metricAlerts: It's property 'criteria' again depends on a single discriminator
Either case evident by the comment // For remaining properties, see MetricAlertCriteria objects
.
In Bicep today, one needs to implement User-defined Types for these cases (ref: AVM web/site), which in case of AVM's web-site module meant adding a bit more than 1.000 lines to provide a type for each scenario.
When trying to create a Resource-derived Type for these properties you end up with:

And nothing beyond.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Personally, it would be great if the already great RDTs feature could be expanded upon so that it can drill further based on the chosen discriminator. I.e., similar to how you can reference a property of an array type via the [*]
like in
param subnetName resourceInput<'Microsoft.Network/virtualNetworks@2024-10-01'>.properties.subnets[*].name
it would be great to be able to do something similar for discriminated types like
param httpSettings resourceInput<'Microsoft.Web/sites/config@2024-11-01'>.properties['authsettingsV2'].httpSettings
Metadata
Metadata
Assignees
Labels
Type
Projects
Status