Intermediateoptimization
CloudCostChefs Oversized App Service Plan Detector
A PowerShell recipe that taste-tests CPU and memory usage to flag underutilized App Service Plans—no guesswork, just data-driven right-sizing.
⏱️ Prep Time:Instant ramen ready
🧩 Difficulty:Intermediate
🔍 What It Does
- 📊 Gathers hourly CPU% and Memory% metrics over a 1–30 day window
- 🔍 Calculates Avg and Max usage so you see both the simmer and the sizzle
- ❗ Flags plans where Avg CPU% < threshold AND Avg Mem% < threshold
- 🖥️ Prints a neatly formatted console table sorted by Avg CPU%
- 🎨 Generates a CloudCostChefs-styled HTML report and opens it in your browser
⚙️ Requirements Checklist
- ✅ PowerShell 5.x or PowerShell Core (Windows/macOS/Linux)
- ✅ Az.Accounts and Az.Monitor modules installed (`Install-Module Az.Accounts,Az.Monitor`)
- ✅ `Connect-AzAccount` or a service principal with Reader + Monitoring Reader roles
- ✅ Access to the subscription containing your App Service Plans
- ✅ Write permissions to folder where HTML report will be saved
📌 Talk Nerdy Tip:
Run this script monthly like a kitchen critique—catch underutilized plans before they inflate your Azure bill.
monitoringoptimizationreportingfinopspowershell