$ show JulianHayward/Azure-MG-Sub-Governance-Reporting
The Azure Governance Visualizer (AzGovViz) is a PowerShell-based tool designed for collecting, analyzing, and reporting on Azure governance, compliance, and security data. It iterates through Azure management group hierarchies to gather information from Azure Resource Manager, Microsoft Graph, and other Azure services, then generates multi-format reports (HTML, CSV, JSON, Markdown) for insights into policy compliance, RBAC, cost optimization, security posture, and more. The tool features a modular function architecture, parallel processing for performance, and caching mechanisms to minimize API calls. It is designed for use in Azure DevOps, GitHub Actions, or local execution scenarios and includes capabilities for Azure Landing Zones compliance checking and orphaned resource identification. Despite its usefulness, the codebase exhibits some complexity and tight coupling due to reliance on global state and very large functions, which may present maintenance challenges.
The LLM identified 2 files worth highlighting for reuse:
This function uses Azure Resource Graph to identify orphaned resources (e.g., deallocated VMs, unattached disks) and processes results in batches to handle API throttling limits. It demonstrates a reusable pattern for efficiently querying large datasets from Azure services while avoiding throttling errors.
This function caches built-in Azure Policy and RBAC definitions at the start of execution to minimize repeated API calls. It stores the data in hash tables for reuse throughout the script, demonstrating a performance optimization pattern for relatively static reference data.