LevelUpWith

Explore / Build and Run a Web App on Azure: Sign-in to Production / Lesson 2

Lesson 2: Cost Control First: Budgets, Alerts, Calculator

Set up cost guardrails before you deploy anything, using Cost Management budgets, alert emails and the pricing calculator.

Free to read, no account needed. Part of Build and Run a Web App on Azure: Sign-in to Production.

By the end of this level you'll be able to

  • Create a monthly subscription budget with actual and forecast alert thresholds that email you
  • Estimate the course app's monthly cost in the pricing calculator and save the estimate
  • Read Cost Analysis grouped by resource group and service to find what is spending money

Why cost control comes before code

Every engineer who has worked with the cloud for a while has a story about a forgotten resource. A test database that stayed up all weekend, or a bigger plan picked "just to try it". The cloud bills you by the hour for anything you leave running, and it won't ask whether you meant to. So before you deploy anything in this course, you'll set up three guardrails:

  1. A budget that emails you as spending goes up.
  2. An estimate of what the finished course app should cost, so you know what normal looks like.
  3. A habit of opening Cost Analysis to see what is actually spending money.

Think of the budget as a smoke alarm, not a sprinkler. Azure budgets send notifications when you cross a threshold, but your resources aren't affected and your consumption isn't stopped. An alert tells you there's a fire. You still have to put it out, and later lessons always end with the command that removes what costs money.

Gotcha: On a brand-new subscription, Cost Management features can take up to 48 hours to become available. If the Budgets page looks empty or gives an error, wait a day and try again.

Step 1: Create a monthly subscription budget

In the Azure portal, open Subscriptions, select your subscription, then select Budgets in the left menu and click Add.

Fill in the form like this (it's a plan to follow, not a script to run):

Scope:          your subscription          # check this first; the default may differ
Name:           budget-webapp-course-monthly
Reset period:   Monthly                    # cost counter starts at zero each month
Creation date:  first day of this month
Expiration:     ~1 year out                # an expired budget is deleted automatically
Amount:         20                         # in your billing currency; pick what you'd tolerate

A reset period of Monthly, Quarterly or Annually follows calendar periods. On pay-as-you-go subscriptions you can also choose Billing month to match your invoice dates. For this course, a calendar month is fine.

Click Next to set the alert conditions. A budget needs at least one threshold and one email address, and you can add up to five thresholds and five email addresses. Each condition has a Type:

  • Actual: fires when the money already spent reaches the percentage.
  • Forecasted: fires when Azure projects that you'll reach the percentage by the end of the period. This is your early warning.

A sensible setup for a learning subscription:

Type         % of budget   Fires when...
Actual       50%           you've really spent 10 of 20
Actual       80%           you've really spent 16 of 20
Actual       100%          you've hit the budget
Forecasted   100%          the trend says you'll pass 20 this month

Alert recipients: you@example.com

The forecasted alert is the one that saves money. If you leave a database running on day 3, the actual-cost alerts may not fire until the third week. The forecast can warn you days earlier.

Best practice: Add azure-noreply@microsoft.com to your approved senders. Otherwise budget emails can land in junk, and an alert nobody reads is no use.

Set your expectations on timing. Cost data usually shows up within 8–24 hours. Budgets are checked against it every 24 hours, and emails normally go out within an hour of that check. So a budget catches slow leaks. It won't catch a spike within minutes. That's another reason to delete resources as soon as you're done with them.

Step 2: Estimate the course app in the pricing calculator

Open the pricing calculator at https://azure.microsoft.com/pricing/calculator/. You don't need to sign in to build an estimate, but you do need to log in to save it. An estimate works like a shopping cart: you add products, then set the region, tier and hours for each.

Add the main pieces the course app will use:

Product                    Configuration                         Monthly (USD, retail)
App Service                Linux, Basic B1, 1 instance, 730 h    ~13.14   # 730 h x $0.018/h (West Europe)
Azure SQL Database         Free offer, serverless                 0.00    # within free limits
Storage account            Blob, a few GB, LRS                    cents   # tiny at course volumes
-------------------------------------------------------------------------
Estimated total                                                  ~13-14

Some notes from experience:

  • 730 hours is the calculator's standard month. If you'll only run something for 40 hours, enter 40. The estimate updates straight away.
  • The Azure SQL Database free offer gives each database 100,000 vCore-seconds of serverless compute, 32 GB of data and 32 GB of backup storage per month, for up to 10 databases per subscription. Leave a query tool connected and you can use that up quickly, because open connections stop the database from auto-pausing.
  • Prices vary by region and change over time. Treat the numbers above as an example and trust what the calculator shows you today.

Now save the estimate. Use Save (log in when asked) and give it a name like webapp-course-baseline. Saved estimates appear under the Saved estimates tab. Export downloads an Excel file, and Share creates a link that others can view but only you can edit.

Trade-off: The calculator shows retail prices for the usage you type in. It can't know about the test VM you'll forget about. That's why you need both an estimate and a budget.

Step 3: Read Cost Analysis to find what's spending

Your estimate says what should happen. Cost Analysis shows what did happen. Open your subscription, then Cost Management → Cost analysis.

Start with the built-in smart views:

  • Resource groups: cost per resource group. Later in the course each part of the app gets its own group, so this view will show which part is costing you.
  • Services: cost per Azure service, such as App Service or SQL Database.

For more control, open a customizable view such as Accumulated costs, set Group by to Resource group name or Service name, and set the granularity to Daily. A healthy course month looks a bit like this:

Group by: Service name     Range: this month     Granularity: Daily

Service name          Cost
Azure App Service     6.30     # about half a month of B1, as expected
Storage               0.04
SQL Database          0.00     # still within the free allowance
Total                 6.34     # budget: 20  ->  32% used

If a row you don't recognise appears, or one service is much higher than your estimate, expand it to see the resource behind it. The ⋯ menu on that row opens the resource so you can stop or delete it.

Habit: Check Cost Analysis weekly. For the first week or two after you deploy or change something, check it daily.

Check it works, and clean up

  • Your budget shows on the Budgets page with its amount and four alert conditions.
  • Your saved estimate is listed under Saved estimates in the calculator.
  • Cost Analysis opens and groups by resource group and service. A new subscription may show nothing yet, which is a good sign.

Nothing in this lesson creates billable resources, so there's nothing to delete. Keep the budget running for the whole course.

Key takeaways

  • Budgets alert; they never stop or delete resources. Cleaning up is still your job.
  • Use both actual and forecasted thresholds. Up to five thresholds and five emails per budget.
  • Cost data lags 8–24 hours and budgets are checked every 24 hours, so budgets catch slow leaks, not instant spikes.
  • The pricing calculator turns usage into an estimate. Save needs a login; Export gives Excel; Share gives a read-only link.
  • In Cost Analysis, group by resource group and service to find where the money goes.

A 6-question knowledge check follows this lesson in the app, free and without an account.

Keep going: levels 3 and 4 are free

Create a free account to open the next two levels, save your progress and pick up where you left off. No card needed.

Next: Level 3, Resource Groups, Regions, Naming, Tags and the CLI.

Create a free account →See the whole course

More like this

  • Microsoft 365 Copilot at Work: A No-Code Guide

    Use Microsoft 365 Copilot with confidence in Outlook, Teams, Word, Excel and PowerPoint. You'll write prompts that get the right result, check every answer and…

    Course · Microsoft · Productivity Suites · Capable · 16 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Azure AI Cloud Developer (AI-200) Exam Prep

    Prepare for Microsoft AI-200 by working through every skill in the October 7, 2026 study guide using short Python SDK code, Azure CLI and the reasoning behind…

    Exam prep · AI-200 · Software & Engineering · Expert · 48 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Azure Fundamentals (AZ-900) Exam Prep

    Learn to pick the cloud model, service type or Azure service that fits a scenario and explain why the alternatives do not, across every skill in the 20 July 20…

    Exam prep · AZ-900 · Cloud & Compute · Capable · 17 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Azure Administrator (AZ-104) Exam Prep

    Work through every bullet of the AZ-104 skills measured as of April 17, 2026, learning each task in the Azure portal, Azure CLI, PowerShell, and ARM templates…

    Exam prep · AZ-104 · Cloud & Compute · Expert · 60 levels · 4 free · Professionally curated by levelupwith.com

  • Support Pro: Helping Users Move to Microsoft 365

    Help users get through a move from Google Workspace to Microsoft 365, from the week before cutover to the first tickets afterwards. You will learn what moves a…

    Course · Microsoft · Suite Support Pro: Configure and Fix · Expert · 40 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft 365 Support Pro: Copilot for End Users

    Learn to work out which Copilot a user actually has, and to fix the everyday Copilot tickets: missing buttons, licence and sign-in problems, files Copilot can'…

    Course · Microsoft · Suite Support Pro: Configure and Fix · Expert · 36 levels · 4 free · Professionally curated by levelupwith.com