feat: RG Scorecard, Findings sheet, and Activity Log improvements#37
Merged
Daren9m merged 7 commits intoMar 20, 2026
Conversation
RG Scorecard: Joins cost + resource count + activity + dormancy per resource group into a single view. Shows monthly cost, days since last activity, dormant resource count, and dormancy percentage. Findings sheet (moved to first position in workbook): - Auto-detects actionable items from all discovery data - Stopped VMs with disk costs still billing - Idle/sample SQL databases (paused GP_S_Gen5, AdventureWorks) - Empty App Service Plans (flags paid tiers as HIGH) - Dormant RGs with high monthly cost - Empty load balancers, orphaned NICs, unused NSGs - Each finding includes: priority, owner, RG cost, recommended action - Sorted by priority then cost impact Tested against Procentrix Dev: 44 findings (10 HIGH, 34 LOW), 99 RGs cross-referenced with cost data. Addresses #34 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 2: - Remove date windowing (13 windows x N subs = 26+ parallel jobs) - Single query per subscription with server-side -Status Succeeded filter - Client-side filter to human write/delete/action ops only (skip system noise) - Expected: ~5-10s per sub instead of 60+ seconds Phase 4: - Same simplification — one query per sub instead of windowed - Add Disable-AzContextAutosave to prevent token cache contention The old approach downloaded 27K+ raw records across 26 parallel jobs just to find "when was this last touched?" The new approach gets the same answer from ~2K filtered records in one query per subscription. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The -Status "Succeeded" parameter on Get-AzActivityLog was filtering too aggressively — returned only 2 raw records instead of thousands. Moved status filtering to client-side where it works reliably. Also removed the Caller "@" filter from Phase 2 (kept in Phase 4 where it's needed for human-only RG creation detection). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add /action$ alongside /write$ and /delete$ — captures operations like VM start/stop, key regeneration, and other management actions that indicate a resource is actively managed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When raw records are returned but no filtered records match, log sample operation names and status values to understand why the filter is dropping everything. Temporary diagnostic to fix the 0-records issue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The OperationName.Value and Status.Value property paths return null on some Az module versions, causing filters to drop all 5,000 records. Simplified to only require a non-empty ResourceId — any activity log record pointing to a resource is useful for last-touch tracking. Removed diagnostic logging (no longer needed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the initial 90-day query hits the 5000 record limit, automatically re-queries in 7-day chunks. If a chunk also hits the limit, halves the window size for remaining queries (down to 1-day minimum). Degrades gracefully when Activity Log API returns sparse data — cost data and KQL queries provide the primary staleness signals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cross-references cost, inventory, and activity data into actionable outputs. Also simplifies and improves the Activity Log phase.
New XLSX Worksheets
Findings (first sheet) — 44 auto-detected items:
RG Scorecard — 97-100 resource groups with:
Activity Log Improvements
Test Plan
Addresses #34
🤖 Generated with Claude Code