Is there any way to fetch azure subscription compliance by specific initiative/policyset

82 views Asked by At

There are many policies applied to subscription, but for me requirement is to fetch the compliance only w.r.t specific initiative/policyset.

Followed this article https://learn.microsoft.com/en-us/azure/governance/policy/how-to/get-compliance-data by wasn't able to that, so needed help or some pointers in fetching compliance data for specific initiative via cli or rest apis.

1

There are 1 answers

0
Sumit Murari On

So solution that I have now is this: https://learn.microsoft.com/en-us/rest/api/policy-insights/policystates/summarizeforsubscription

We need to make POST request to https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/summarize?api-version=2019-10-01

Above API call returns the data for all policies applied to the subscription and there we can also list initiatives, from there we can filter specific initiative/policyset and it's compliance status.