Intermediatereporting
Azure VM Deallocation Detective
Professional PowerShell script that hunts down deallocated VMs like a detective chef tracking down forgotten ingredients in the kitchen. Generate detailed CSV and HTML reports for VM lifecycle management.
⏱️ Prep Time:Perfect detective timing
🧩 Difficulty:Intermediate
🔍 What It Does
- 🔍 Multi-subscription VM deallocation analysis across your entire Azure estate
- 📊 Dual output formats: Detailed CSV data and visual HTML reports
- ⚡ Performance modes: Fast estimates or detailed Activity Log analysis
- 🏷️ Smart owner detection through comprehensive tag analysis
- 💾 Disk size analysis with intelligent estimation for missing data
- 📅 Configurable aging thresholds to focus on VMs that matter
- 🎯 Azure Resource Graph integration for lightning-fast VM discovery
- 📈 Comprehensive reporting with subscription, region, and cost insights
⚙️ Requirements Checklist
- ✅ PowerShell 5.1+ with Azure PowerShell modules (Az.Accounts, Az.Resources, Az.ResourceGraph, Az.Compute, Az.Monitor)
- ✅ Azure authentication with appropriate subscription access permissions
- ✅ Reader role on target Azure subscriptions for VM analysis
- ✅ Internet connectivity to Azure Management API endpoints
- ✅ Understanding that detailed deallocation dates require Activity Log access
📌 Talk Nerdy Tip:
Start with a 30-day threshold and fast mode to quickly identify long-deallocated VMs before diving into detailed analysis. Like checking the pantry for expired ingredients before cooking. 👨🍳
vm-analysisazuredeallocationreportingpowershellcsv-exporthtml-reportlifecycle-managementresource-graphvm-detective