Forum Discussion
Diagnostic setting Policy Initiative
- Jun 30, 2020
pvyver great question! No "out-of-the-box" diagnostic setting policy initiative is planned as of yet. As Tao points out the best way to do this is via Azure policy. Agreed, that pre-built policies only exist for a subset of resource types, but a policy can be authored per resource type. Definitely something we can look into though.
pvyver You can also check out a script that we have available, that creates Azure Custom Policies for Azure resource types that support Azure Diagnostics logs and metrics. Policies can be created for both Event Hub and Log Analytics sink points with this script. Check it out here: https://github.com/JimGBritt/AzurePolicy/tree/master/AzureMonitor/Scripts
- JimBritt-MSFTJun 30, 2020
Microsoft
pvyver Spot on yes. There is a gap today in what you are looking for around "Auto Generation of Policy". There is work being done to improve this experience but for now this is probably one of the best approaches to take to at least remove the strain of building the policies to begin with. Your point is well taken however and has been a challenge from the beginning as unless the resource exists, there is no way to know what that resourceType supports related to metrics and log categories.