Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 9 of 47
❮Prev Next❯

Manage Costs with Budgets, Alerts and Azure Advisor

Module 1: Identity & Governance ⏱ 10 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    In Microsoft Cost Management a budget sets a spending limit for a scope (management group, subscription, resource group, optionally filtered by tag) over a reset period (monthly, quarterly or annually). Its alert conditions fire on Actual or Forecasted cost at a percentage you choose, emailing recipients and optionally calling an action group. A budget doesn't stop resources by itself; automation behind the action group can. Cost alerts collect budget, credit and anomaly alerts. Azure Advisor gives free cost recommendations, such as right-sizing or shutting down idle VMs and buying reservations. Cost data refreshes a few times a day, so alerts aren't instant.

    Simulate it » No Azure account needed

    Exam objective: 1.3.6 Manage costs by using alerts, budgets, and Azure Advisor recommendations. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Create a budget with alerts and review Advisor Create a budget with alerts and read Advisor's cost tips.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Search for <strong>Cost Management</strong>, then pick the subscription scope.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Search for Cost Management, then pick the subscription scope.
    2. Type cost management in the search bar and pick Cost Management under Services.
    3. Under Monitoring → Budgets, select + Add.
    4. A filter on tag costcenter = FIN-042 makes this the finance team's budget. Reset period decides when the count starts again.
    5. Actual alerts fire on what you've spent; Forecasted fires when Azure predicts you'll cross the line. An action group can email, text or run an automation.
    6. Spend data refreshes a few times a day, so alerts aren't instant. Here the 50% and 80% alerts have already fired, and Cost alerts lists them with any anomaly alerts.
    7. Now search for Advisor.
    8. Type advisor in the search bar and pick Advisor under Services.
    9. Azure Advisor recommends savings across Cost, Security, Reliability, Operational excellence and Performance. CLI: az advisor recommendation list --category Cost -o table.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    The finance team found out about a runaway bill when the invoice arrived.

    😊 THE SOLUTION

    Set budgets with actual and forecast alerts, and act on Advisor's cost tips.

    • Surprise invoices✓ Budget alerts at 50, 80, 100%
    • Overspend spotted too late✓ Forecasted alerts
    • Idle VMs running✓ Advisor right-size tips
    🛠️ Solved with: Budgets, cost alerts and Advisor

    Start with a question

    How do you stop your phone bill from shocking you at the end of the month?

    Most phone apps let you set a data warning: a text at 50% of your allowance, another at 80%. Some even tell you “at this rate you’ll run out by the 20th”. The warning doesn’t cut you off, it just gives you time to switch to Wi-Fi. And now and then the app suggests a cheaper plan because you never use half of what you pay for.

    In Azure the warnings are budget alerts (actual and forecasted), and the “cheaper plan” tip is Azure Advisor.

    Explain it like I’m 10

    The technical explanation

    Budgets

    Portal: Cost Management → Budgets → + Add (pick the scope first). Two tabs:

    Create a budget

    • Scope: management group, subscription, resource group (or a billing scope). Filters narrow it, for example Tag: costcenter = FIN-042 or one resource type.
    • Budget details: name, reset period (Monthly, Quarterly, Annually, or billing month/quarter/year), creation date and expiration date.
    • Budget amount, with a suggested figure based on past spend.

    Set alerts

    • Alert conditions: Type (Actual or Forecasted), % of budget, and an optional action group.
    • Alert recipients (email) and language.
    az consumption budget create --budget-name fin-monthly --amount 500 \
      --category cost --time-grain monthly \
      --start-date 2026-12-01 --end-date 2027-11-30 --resource-group rg-finance
    az consumption budget list -o table
    New-AzConsumptionBudget -Name fin-monthly -Amount 500 -Category Cost -TimeGrain Monthly `
      -StartDate 2026-12-01 -EndDate 2027-11-30 -ContactEmail finance-ops@contoso.com -NotificationKey a80 -NotificationThreshold 80 -NotificationEnabled

    Budgets don’t stop anything. To act, point an alert at an action group that runs an Automation runbook, Logic App, Azure Function or webhook, for example to deallocate dev VMs. Cost data is refreshed several times a day (up to about every 4 hours for most scopes), so alerts can lag real spending.

    Cost alerts

    Cost Management → Cost alerts lists budget alerts, credit alerts (for prepaid commitments) and department spending quota alerts for EA, plus anomaly alerts, which you subscribe to from Cost analysis’s smart views to get an email when daily spend jumps or drops unexpectedly.

    Azure Advisor

    Advisor is free and studies your usage. Its Cost recommendations include:

    • Right-size or shut down underutilised VMs (based on CPU and network over a lookback period you can configure).
    • Buy reservations or savings plans for steady workloads.
    • Delete unattached public IP addresses and idle resources.
    • Use lifecycle management or cheaper tiers for storage.

    Each recommendation shows impact, affected resources and estimated savings, and you can postpone or dismiss it. Advisor also covers Security, Reliability, Operational excellence and Performance, and an Advisor score shows progress. You can set up Advisor alerts and weekly recommendation digests to an action group.

    az advisor recommendation list --category Cost -o table
    az advisor configuration update --low-cpu-threshold 10    # VM utilisation rule
    1. 1 Set

      $500 monthly budget filtered to costcenter = FIN-042.

    2. 2 Day 14

      Forecasted 100% alert: on track to spend $560. Finance gets an email.

    3. 3 Act

      Advisor flags two idle VMs; the team deallocates them.

    4. 4 Day 30

      Actual spend lands at $470: the 80% alert fired, 100% never did.

    A month for the finance team's budget
    Architect level Budgets at scale

    Budgets can be deployed with ARM, Bicep or the Consumption REST API, so a subscription-vending pipeline can create one for every new subscription. Management group budgets work for most offer types but not every billing setup; check the scope support for your agreement. For chargeback, combine tag policies (so the data is right), cost allocation rules (to split shared costs like a hub network) and scheduled exports to a storage account for Power BI.

    Real-world business scenario

    Import and distribution

    Wide World Importers (fictional)

    The problem
    A load test left 40 large VMs running over a long weekend, and the bill arrived three weeks later, triple the usual amount.
    What they used
    Monthly budgets on each subscription with Actual alerts at 50% and 80% and a Forecasted alert at 100%. The dev subscription's 90% alert calls an action group that runs an Automation runbook to deallocate VMs tagged env=dev. Anomaly alerts and Advisor's weekly digest go to the platform team.
    Why that choice
    Overspend shows up within hours instead of weeks, and dev environments switch themselves off before the budget is gone.
    The result
    Monthly spend became predictable, and acting on Advisor's right-size tips saved about 18% on compute.

    When to use it and when not to

    ✓ Use it when…

    • A budget on every subscription, with Actual and Forecasted alerts.
    • Tag-filtered budgets when several departments share a subscription.
    • Action groups with automation for non-production shutdowns.

    ✕ Think twice when…

    • Treating a budget as a hard spending cap.
    • Acting on Advisor right-size tips for workloads with rare but important peaks without checking first.

    ↔ Alternatives to consider

    • Reservations and savings plans for steady workloads, which Advisor recommends.
    • Auto-shutdown on dev VMs, which needs no budget at all.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    The finance team must receive an email when the actual monthly cost of a subscription reaches 80 percent of 5,000 USD. What should you create?

    Question 2

    Question 2 of 5 · Select 2

    Virtual machines in a development subscription must be deallocated automatically when spending reaches 90 percent of the monthly budget. Which two components should you configure? Each correct answer presents part of the solution.

    Question 3

    Question 3 of 5

    You need to be notified before month end if spending is projected to exceed the budget. Which alert type should you use?

    Question 4

    Question 4 of 5

    You need to identify virtual machines that are underutilized so you can resize or shut them down. What should you use?

    Question 5

    Question 5 of 5

    Three departments share one subscription. Each department must have its own monthly budget. Resources are tagged with a department tag. What should you do?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner Does an Azure budget stop spending when you hit it?

    Model answer

    No. A budget only alerts. If you want something to happen, like shutting down dev VMs, you connect an action group that runs an automation runbook or a Logic App. Spending limits that actually stop services exist only on some credit-based offers.

    Intermediate Actual or forecasted alerts?

    Model answer

    Both. Actual at 50 and 80 percent tells you where you are. Forecasted at 100 percent warns you mid-month that you're on track to overspend, which gives you time to act instead of finding out on the last day.

    Experienced developer How would you give each department its own budget in one subscription?

    Model answer

    Tag resources with costcenter, enforce the tag with policy, then create a budget per department at the subscription scope with a filter on that tag value. Each budget's alerts go to that department's distribution list and action group.

    Scenario Finance wants dev/test VMs shut down automatically if the dev subscription hits 90% of budget. How?

    Model answer

    A budget on the dev subscription with an Actual alert at 90% that calls an action group. The action group triggers an Automation runbook or Logic App with a managed identity that has Virtual Machine Contributor, which deallocates the tagged dev VMs.

    Quick revision

    Key points

    • Budgets have a scope, amount, reset period, start and expiry dates, and optional filters such as tags.
    • Alert conditions are Actual or Forecasted at a percentage, sent to emails and optionally an action group.
    • Budgets don't stop resources. Use an action group with automation to act.
    • Cost data refreshes a few times a day, so alerts lag spending.
    • Advisor cost recommendations - right-size or shut down idle VMs, reservations, delete unused public IPs and disks.

    Important terminology

    Budget
    A spending target for a scope and reset period, with alert conditions at percentages of the amount.
    Actual alert
    A budget alert that fires when accrued cost reaches the threshold.
    Forecasted alert
    A budget alert that fires when Azure predicts cost will reach the threshold by the end of the period.
    Action group
    An Azure Monitor list of notifications and actions (email, SMS, webhook, runbook, Logic App) that alerts can call.
    Anomaly alert
    A Cost Management alert when daily spend is unusually high or low compared with the usual pattern.
    Azure Advisor
    A free service that recommends improvements in cost, security, reliability, operational excellence and performance.
    Advisor score
    A percentage that shows how closely your resources follow Advisor's recommendations.

    Common mistakes

    • Expecting a budget to cap spending on a pay-as-you-go subscription.
    • Relying only on Actual alerts and finding out about overspend at the end of the month.

    Exam tips

    • "Email the team when spend reaches 80%" = budget with an Actual 80% alert.
    • "Shut down resources automatically when the budget is reached" = budget alert + action group + runbook or Logic App.
    • "Identify underused VMs" = Azure Advisor cost recommendations.

    Five quick revision questions

    1. 1.What are the two alert types on a budget?Show

      Actual and Forecasted.

    2. 2.Does a budget stop resources when it's exceeded?Show

      No. It sends alerts; automation must do the stopping.

    3. 3.Which service recommends right-sizing idle VMs?Show

      Azure Advisor.

    4. 4.What can a budget alert call besides email?Show

      An action group (SMS, webhook, runbook, Logic App and more).

    5. 5.Which CLI command lists Advisor cost recommendations?Show

      az advisor recommendation list --category Cost

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Storage Firewalls and Virtual Network Rules

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.