Reputation: 327
I wanted to get all diagnostic settings from azure under my subscription. I want all either enable or disable. I am using the below API but it doesn't help as it required workflow and I don't have workflows.
https://learn.microsoft.com/en-us/rest/api/monitor/diagnosticsettings/list
I modified it and used the below it returns nothing. as on azure I have a total of 8 settings and 1 is enabled and others are disabled.
https://management.azure.com/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings?api-version=2017-05-01-preview
Upvotes: 0
Views: 1109
Reputation: 136346
I don't think that you will be able to get the diagnostics settings for all the resources in your Azure Subscription in a single API call.
From the documentation link
:
Gets the active diagnostic settings list for the specified resource.
The reason you're not getting any results back is because you're trying to get diagnostics settings for your subscription resource and AFAIK there are no diagnostics settings that can be defined at the subscription level.
What you would need to do is list down all the resources in your SUbscription and then for each resource you will need to get diagnostics settings separately.
Upvotes: 0