Standard ghost-hunting workflow
Structured quick-reference sections for prerequisites, installation, usage, and troubleshooting.
Prerequisites
- PowerShell 5.1+ with Azure PowerShell modules (Az.Accounts, Az.Network, Az.Resources)
- Reader access on target subscriptions and load balancer resources
- Azure authentication configured before execution (`Connect-AzAccount`)
- Local folder path available for CSV/HTML output if using custom paths
Key parameters
| Parameter | Purpose | Example |
|---|---|---|
| -SubscriptionIds | Scopes the scan to one or more subscriptions | "sub-123,sub-456" |
| -CsvPath | Sets custom CSV report path | "./reports/ghosts.csv" |
| -HtmlPath | Sets custom HTML report path | "./reports/ghosts.html" |
If no output paths are provided, the script generates timestamped report files automatically.
Standard ghost-hunting workflow
- 1Run a tenant-wide scan first to establish the baseline and identify high-score ghost candidates.
- 2Filter the report for `GhostScore >= 80` and review backend pools/rules before remediation.
- 3Validate ownership and environment context for high-cost load balancers before deleting or resizing.
.\\Azure-LoadBalancer-GhostHunter.ps1.\\Azure-LoadBalancer-GhostHunter.ps1 -SubscriptionIds "sub-123,sub-456".\\Azure-LoadBalancer-GhostHunter.ps1 -CsvPath "./reports/ghosts.csv" -HtmlPath "./reports/ghosts.html"Ghost score interpretation
| Score range | Classification | Recommended action |
|---|---|---|
| 80+ | Definite Ghost | Validate once, then prioritize for cleanup |
| 60-79 | Likely Ghost | Investigate config gaps before cleanup |
| 40-59 | Suspicious | Monitor usage and confirm business intent |
| 20-39 | Review Needed | Inspect config for optimization opportunities |
| 0-19 | Active | Usually retain unless other signals indicate waste |
Report output highlights
The HTML/CSV reports include scoring and estimated cost so teams can prioritize remediation by financial impact.
| Column | Example | Why it matters |
|---|---|---|
| GhostStatus | DEFINITE GHOST | Quick triage for cleanup queues |
| GhostScore | 92 | Confidence score from multi-factor analysis |
| EstimatedMonthlyCost | $22.56 | Savings prioritization |
| BackendPoolMembers | 0 | Strong signal of likely non-use |
Troubleshooting
- If no load balancers are returned, verify subscription scope and Reader access on `Microsoft.Network/loadBalancers`.
- If ghost scores look unexpectedly low, review health probe and frontend IP configurations that can reduce the score.
- If report files are missing, provide explicit `-CsvPath` / `-HtmlPath` values and confirm the directories exist.
Do not auto-delete on score alone
Ghost score is a prioritization signal, not a deletion approval. Validate ownership, recent traffic, and dependency context before cleanup.
Intelligent Ghost Detection
Advanced analysis and scoring system to identify unused Azure Load Balancers with precision
Ghost Scoring System
Intelligent scoring algorithm that analyzes multiple factors to determine ghost likelihood (0-100 scale)
Comprehensive Analysis
Analyzes backend pools, load balancing rules, NAT rules, frontend IPs, and health probes
Cost Estimation
Calculates monthly cost estimates based on load balancer SKU and configuration complexity
Status Classification
Categorizes load balancers as Definite Ghost, Likely Ghost, Suspicious, Review Needed, or Active
Multi-Subscription Support
Scans across multiple Azure subscriptions with proper authentication and access control
Health Probe Analysis
Evaluates health probe configurations to identify load balancers without proper health monitoring
Backend Pool Intelligence
Analyzes backend pool configurations and member counts to identify unused or empty pools
Detailed Reporting
Generates comprehensive CSV and HTML reports with ghost scores, cost estimates, and recommendations
Ghost Scoring Algorithm
Intelligent multi-factor analysis to determine load balancer utilization and ghost likelihood
Scoring Factors
Backend Pool Analysis (50 points)
- • No backend pools configured (+50 points)
- • All backend pools are empty (+45 points)
- • Some backend pools are empty (+25 points)
Load Balancing Rules (30 points)
- • No load balancing rules configured (+30 points)
Health Probes (20 points)
- • No health probes configured (+20 points)
Additional Factors
- • No inbound NAT rules (+10 points)
- • No frontend IP configurations (+40 points)
- • Unused frontend IP configurations (+15 points)
Ghost Classification
DEFINITE GHOST
Score ≥ 80Load balancers with minimal or no configuration. Strong candidates for immediate cleanup.
LIKELY GHOST
Score ≥ 60Load balancers with significant configuration gaps. Require investigation before cleanup.
SUSPICIOUS
Score ≥ 40Load balancers with some concerning patterns. Monitor usage and validate necessity.
REVIEW NEEDED
Score ≥ 20Load balancers with partial configuration. Review for optimization opportunities.
ACTIVE
Score < 20Load balancers with comprehensive configuration. Likely serving active traffic.
Usage Examples
Real-world scenarios for Azure Load Balancer optimization and ghost detection
Complete Tenant Scan
.\Azure-LoadBalancer-GhostHunter.ps1Scans all accessible subscriptions to identify ghost load balancers across your entire Azure tenant.
Targeted Subscription Analysis
.\Azure-LoadBalancer-GhostHunter.ps1 -SubscriptionIds "sub-123,sub-456"Focuses analysis on specific subscriptions for targeted ghost hunting and cost optimization.
Custom Report Location
.\Azure-LoadBalancer-GhostHunter.ps1 -CsvPath"./reports/" -HtmlPath"./reports/"Specifies custom output directories for CSV and HTML reports with organized file management.
Comprehensive Analysis
.\Azure-LoadBalancer-GhostHunter.ps1 -SubscriptionIds "prod-sub" -CsvPath"./audit/"Performs detailed analysis of production subscription with audit-ready reporting for compliance.
Technical Specifications
Enterprise-grade PowerShell script with comprehensive Azure Load Balancer analysis capabilities
Requirements
Modern PowerShell with Azure module support
Az.Accounts, Az.Network, Az.Resources modules installed
Valid Azure credentials with appropriate permissions
Reader role on target subscriptions and load balancer resources
Internet access to Azure management endpoints
Command Line Parameters
-CsvPathPath for CSV export (default: timestamped file)
-HtmlPathPath for HTML report (default: timestamped file)
-SubscriptionIdsComma-separated subscription IDs to scan
Core Features
Analysis Engine
- • Multi-factor ghost scoring algorithm (0-100 scale)
- • Backend pool configuration analysis
- • Load balancing rules evaluation
- • Health probe configuration assessment
Cost Analysis
- • Monthly cost estimation by SKU type
- • Standard Load Balancer: $22.56 base cost
- • Basic Load Balancer: $18.25 estimated cost
- • Rule-based cost calculations with complexity factors
Reporting Capabilities
- • Detailed CSV export with all metrics
- • Rich HTML reports with visual styling
- • Ghost status classification and recommendations
- • Backend pool member count analysis
Enterprise Features
- • Multi-subscription scanning with parallel processing
- • Comprehensive error handling and logging
- • CloudCostChefs professional styling and branding
- • Detailed progress tracking and status updates
Comprehensive Reporting
Professional reporting in multiple formats with detailed analytics and actionable insights
CSV Data Export
Structured CSV export optimized for data analysis, filtering, and integration with business intelligence tools.
HTML Executive Report
Rich HTML report with CloudCostChefs styling, ghost status visualization, and executive-friendly presentation.
Chef's Tips & Best Practices
Professional recommendations for effective Azure Load Balancer ghost hunting and optimization
Authentication Setup
Ensure proper Azure PowerShell authentication before running the script. Like prepping your kitchen, proper authentication ensures smooth ghost hunting operations.
Subscription Strategy
Start with non-production subscriptions to understand ghost patterns. Like tasting ingredients before the final dish, test your approach before production hunting.
Score Interpretation
Focus on"Definite Ghost" (80+) and"Likely Ghost" (60+) scores for immediate action. Like identifying overripe ingredients, high scores indicate clear cleanup candidates.
Cost Impact Analysis
Use cost estimates to prioritize cleanup efforts and calculate potential savings. Standard Load Balancers cost more than Basic, making them higher priority targets.
Stakeholder Communication
Use HTML reports for executive communication and CSV data for technical analysis. Present findings like a chef explaining the menu - clear, professional, and actionable.
Regular Monitoring
Schedule regular ghost hunting sessions to prevent accumulation of unused resources. Like maintaining a clean kitchen, regular monitoring prevents ghost buildup.
Ready to Hunt Azure Load Balancer Ghosts?
Download the Azure Load Balancer Ghost Hunter and start identifying unused load balancers consuming resources in your Azure environment. Professional ghost detection with intelligent scoring.
What to do next
Pick the path that fits where you are right now.