Report on Azure Policy Compliance with PowerShell
Pull policy assignments, compliance state, non-compliant resources, and exemption usage from one PowerShell workflow.
Azure Policy is one of the cleanest governance tools in any major cloud, and one of the easiest to let drift. New initiatives get assigned at the management group, exemptions accumulate, and the compliance percentage on the dashboard slowly stops being trustworthy.
The Az.PolicyInsights module exposes assignments, compliance state, exemptions, and remediation tasks. PSForge gives you the Azure Policy tasks ready to assemble into a workflow that produces the report your governance team can actually use.
What a real policy compliance workflow should produce
- Every policy and initiative assignment, with scope and enforcement mode
- Compliance percentage per assignment with the trend versus last month
- Non-compliant resources listed by assignment with the failing rule
- Active policy exemptions, who created them, and when they expire
- Remediation tasks in flight and their status
Why this is a workflow
Azure Policy data is rich enough that it does not fit on one portal screen and does not stay current if it is only checked manually.
PSForge lets you assemble the Azure Policy tasks into one workflow, generate the PowerShell, and schedule it so governance, security, and platform teams all see the same numbers.
Example Azure Policy compliance workflow
- Connect to Azure and iterate the management group hierarchy
- Enumerate every assignment with scope and enforcement mode
- Capture compliance percentage per assignment and the trend versus the previous run
- List non-compliant resources by assignment and failing rule
- Pull active exemptions with creator, justification, and expiration
- Report on remediation tasks in flight and their status
- Send the consolidated policy report to the governance distribution list
Final thoughts
Azure Policy is most useful when its results are visible to people other than the person who set it up.
PSForge makes it easy to build a single PowerShell workflow that keeps assignments, compliance state, exemptions, and remediation under steady, scheduled review.