2.1.4.5. Manage Costs by Using Azure Advisor Recommendations
2.1.4.5. Manage Costs by Using Azure Advisor Recommendations
💡 First Principle: A budget tells you that you are spending; it can't tell you what you are wasting. Advisor closes that gap by reading each resource's configuration and utilization telemetry and naming the specific change, such as a smaller SKU, a shutdown or a reservation, that would lower the bill.
Scenario: Your Cost Management budget for the Production subscription fired its 90% alert two weeks early. Cost analysis shows virtual machines are the largest line item, but not which ones are oversized. You need a ranked list of savings, a way to silence recommendations that don't apply, and a notification the next time Advisor finds something new.
What It Is: Azure Advisor analyzes resource configuration and usage telemetry and produces recommendations in five categories: Reliability, Security, Performance, Cost and Operational excellence. The Cost tab lists cost recommendations, each with an impact level and estimated savings. Anyone with Reader, Contributor or Owner on the subscription, resource group or resource can see them; you only see recommendations for resources you can access.
Main Cost Recommendation Types:
- Right-size or shut down underutilized VMs and scale sets (how they're calculated). A shutdown recommendation uses CPU and outbound network only (memory isn't considered): P95 of maximum CPU below 3%, P100 of average CPU over the last 3 days at or below 2%, and outbound network below 2%. A resize recommendation also considers memory and only proposes a cheaper SKU that keeps the same Accelerated Networking and Premium Storage capabilities. Advisor can also propose B-series burstable SKUs for spiky, mostly idle workloads.
- Reservations and savings plans: "Consider virtual machine reserved instance" (and equivalents for SQL, Cosmos DB, App Service and others) based on your usage over the selected term and look-back period, plus "Consider purchasing a savings plan" and "Configure automatic renewal for the expiring reservations".
- Idle or orphaned resources: for example App Service plans to right-size, idle Azure Cosmos DB containers, and stopped Data Explorer clusters. Several newer checks (unattached disks, virtual network gateways with no connections, unprovisioned ExpressRoute circuits) are still labelled preview.
Tuning the VM Recommendations (Advisor > Configuration):
- VM/VMSS right sizing tab: per subscription, set the average CPU utilization filter. The CLI accepts 5, 10, 15 or 20 (
--low-cpu-threshold). This filters which machines are shown; it doesn't change how recommendations are generated, and it can take up to 24 hours to apply. - Lookback period: 7 (default), 14, 21, 30, 60 or 90 days. After a change, recommendations can take up to 48 hours to update.
- Resources tab: include or exclude whole subscriptions or resource groups (for example, a sandbox). Editing rules and subscription configuration needs Contributor or Owner on the subscription (permissions).
Postpone, Dismiss, Complete:
- Postpone hides a recommendation for a period you choose; it then returns to Active automatically.
- Dismiss removes it until someone reactivates it, and records a reason.
- Complete marks that you acted; Advisor also checks about every 24 hours and marks recommendations Completed (system verified) when they no longer apply. You need Contributor (or better) on the affected resource to postpone or dismiss. The full state-management experience is documented as preview (recommendation states).
Advisor Score: The Advisor score is an overall percentage averaged from the five category scores. The Cost score weights recommendations by retail cost, counts long-standing recommendations more heavily, and entirely removes postponed or dismissed resources from the calculation. Scores refresh at least daily, and a fix takes at least 24 hours to show.
Alerts on New Recommendations: When Advisor creates a recommendation, it writes an event to the Azure activity log. Advisor > Alerts > New Advisor Alert creates an alert scoped to a subscription (optionally a resource group), filtered by category and impact level or by recommendation type, that fires an action group (email, SMS, webhook). Advisor alerts support Cost, Performance and High Availability recommendations, not Security (Advisor alerts).
How It Relates to Budgets: Budgets, covered in 2.1.4.3 Configure Cost Management, alert on spending thresholds; Advisor alerts on new optimization opportunities. Use both: the budget tells you to look, and Advisor tells you where. Remember that Advisor savings use retail (pay-as-you-go) rates and don't account for your discounts or existing reservations, so real savings can be lower.
Practical Implementation: Advisor Cost Settings with Azure CLI
# Show only low-usage VMs at 5% average CPU in this subscription
az advisor configuration update --low-cpu-threshold 5
# Exclude a sandbox resource group from recommendation generation
az advisor configuration update --resource-group rg-sandbox --exclude
# List cost recommendations
az advisor recommendation list --category Cost --output table
# Hide one recommendation for 30 days (omit --days and it stays disabled until re-enabled)
az advisor recommendation disable --name <recommendation-name> --resource-group rg-prod --days 30
⚠️ Common Pitfall: Acting on a resize recommendation without checking reservations. Advisor's estimates ignore Reserved Instance and savings plan purchases, and a cross-series resize can move a VM off the SKU your reservation covers, raising the bill.
⚠️ Exam Trap: Match the action to the intent. A recommendation that should come back later is postponed; one that never applies (a deliberately idle disaster-recovery VM) is dismissed; a whole test subscription that should never be analyzed is excluded in Configuration.
Key Trade-Offs:
- Aggressive vs. Conservative Thresholds: A higher CPU filter and short lookback surface more savings, but risk resizing machines that are busy only at month end. A longer lookback catches those cycles at the cost of slower feedback.
- Dismiss vs. Postpone: Dismissing cleans the list and the score permanently but can hide advice that later becomes valid; postponing forces a periodic re-check.
Reflection Question: Your Cost score rose 10 points overnight, but the bill didn't change. Which Advisor actions could cause that, and how would you check whether the improvement is real?