Bicep Module for Creating Diagnostic Settings for Different Azure Resources
Hi
I would like to create a module to enable Diagnostics Settings for various Azure resources. The idea is to be able to pass the resource type that can be accepted by the "scope" property within the module definition (Microsoft.Insights/diagnosticSettings--> https://learn.microsoft.com/en-us/azure/templates/microsoft.insights/diagnosticsettings?pivots=deployment-language-bicep#resource-format). However, Bicep doesn't allows defining a parameter type (other than the standard such as String, SecureString, Object etc.) that can hold the type of a resource. If I try and define this property as "String" within the module, VS Code starts complaining this:
The property "scope" expected a value of type "resource | tenant" but the provided value is of type "string".
I'm sure this is a common ask and there must be a way around it....can someone please share other possible approach to this?
Thanks
Taranjeet Singh