Get Azure diagnostic settings information associated to a resources

128 Views Asked by At

Is there any way in azure to gather the information about which resources have associated the diagnostic logs settings?

I was exploring graph but is not possible yet, I was maybe exploring azure data explorer but with no success. I know that using PowerShell and az cli I can retrieve diagnostic information, but I as looking for something more straight forward to do so.

the idea is check which resources have associated certain options in the azure diagnostic logs settings and which ones don't

1

There are 1 best solutions below

0
Jahnavi On

Get Azure diagnostic settings information associated to a resources:

When it comes to Azure CLI to retrieve the diagnostic settings linked to an Azure resource, you can below command as shown below.

az monitor diagnostic-settings list --resource staging-testwebsite-app --resource-group xxxx --resource-type Microsoft.Web/sites

enter image description here

But as you mentioned, you need a different approach to achieve the same requirement. For that, use below KQL query AzureDiagnostics table which gives your required outcome. Change the type of the resource provider accordingly.

AzureDiagnostics
| where Type == "Microsoft.Web/sites"
| project ResourceId, Resource

enter image description here

Note: I would suggest you using CLI or REST API the better options to achieve your requirement without any conflicts in case of large amount of data.