Cloud Pricing: Consumption, Serverless, and Pay-as-You-Go
How does Azure actually charge you? From pay-as-you-go to reserved instances to serverless — understand the pricing models so you can pick the cheapest option for every scenario.
How does cloud pricing work?
Think of three ways to pay for a gym.
Pay-as-you-go = casual visit passes. You pay each time you go. Flexible, but expensive if you go every day.
Reserved = annual membership. You commit to a year upfront and get a big discount. Great if you know you’ll go regularly.
Serverless = like a personal trainer who only charges for the minutes they actually train you. You don’t pay for the gym itself — just the exact service you receive.
Azure pricing works the same way. Different workloads benefit from different pricing models.
Cloud pricing models compared
| Feature | Pay-as-You-Go | Reserved | Spot | Serverless |
|---|---|---|---|---|
| Commitment | None | 1 or 3 years | None | None |
| Cost | Highest per-unit | Up to 72% savings | Up to 90% savings | Pay per execution |
| Best for | Unpredictable workloads | Steady-state workloads | Batch processing | Event-driven tasks |
| Risk | Costs can spike | Locked in if needs change | Resources can be reclaimed | Cold start delays |
| Example | Dev/test VMs | Production databases | Video rendering | API that runs on demand |
Pay-as-you-go in practice
This is the default Azure pricing model. You spin up a resource, use it, and get billed for what you consumed.
Peak Roasters’ monthly bill might look like (illustrative — actual prices vary by region and change over time):
| Resource | Usage | Cost |
|---|---|---|
| Virtual machine (B2s) | 720 hours (always on) | ~$30/month |
| Blob storage | 50 GB stored | ~$1/month |
| SQL Database (Basic) | 5 DTU | ~$5/month |
| Bandwidth (outbound) | 15 GB | ~$1.30/month |
| Total | ~$37/month |
Key concept: Inbound data (uploading to Azure) is free. You only pay for outbound data (downloading from Azure to the internet). This is called egress charges and catches people off guard.
Reserved instances — commitment saves money
Summit Construction runs production VMs 24/7 for their project management system. Paying as-you-go, a D2s v5 VM costs around $70/month. By reserving for 3 years, they pay around $25/month — a 64% saving.
When to reserve:
- Workloads that run continuously (production servers, databases)
- Predictable capacity needs
- Budgets that benefit from lower, fixed costs
When NOT to reserve:
- Dev/test environments (turn on/off frequently)
- Experimental projects
- Workloads with unpredictable demand
Exam tip: Reserved vs pay-as-you-go scenarios
The exam loves scenario questions like: “A company runs a production database 24/7. How can they reduce costs?”
Answer: Reserved instances — committing to 1 or 3 years gives significant discounts for always-on workloads.
But if the scenario says “development environment used occasionally” or “testing server running a few hours a week” — the answer is pay-as-you-go, because you’d waste money reserving something you barely use.
What is serverless?
Serverless computing is a cloud execution model where:
- The cloud provider manages all infrastructure — you never see or configure a server
- You only pay when your code actually runs — zero cost when idle
- It scales automatically — from zero to thousands of executions
The name is misleading. Servers definitely exist — you just don’t manage them. The provider handles provisioning, scaling, patching, and availability.
Serverless in Azure
| Azure Service | What It Does | You Pay For |
|---|---|---|
| Azure Functions | Run small pieces of code in response to events | Number of executions + execution time |
| Azure Logic Apps | Automate workflows without writing code | Number of actions executed |
| Azure Event Grid | Route events between services | Number of events processed |
Kai’s serverless project
Kai, a university student, builds a serverless API for their class project. Using Azure Functions:
- The API processes student submissions
- During the day, it handles 500 requests
- At night, it handles zero requests
- Monthly cost: about $0.50 (first 1 million executions are free)
If Kai had used a virtual machine instead, the cheapest option would cost ~$4/month running 24/7 — even though it sits idle 90% of the time.
Serverless vs containers vs VMs
These three approaches represent different levels of abstraction:
| Level | Technology | You Manage | Provider Manages |
|---|---|---|---|
| Most control | Virtual Machines | OS, runtime, app, data | Physical hardware |
| Middle ground | Containers | App and its dependencies | OS, runtime, infrastructure |
| Least control | Serverless | Just your code | Everything else |
Serverless = maximum abstraction. You write code, the cloud handles the rest. But you lose control over the underlying infrastructure.
🎬 Video walkthrough
🎬 Video coming soon
Cloud Pricing Models — AZ-900
Cloud Pricing Models — AZ-900
~8 minFlashcards
Knowledge Check
Summit Construction runs a production database server 24/7 in Azure. The monthly pay-as-you-go cost is $200. Which pricing approach would MOST reduce their costs?
Kai builds a small API using Azure Functions. The API handles 200 requests per day during term time and zero requests during holidays. Which pricing characteristic makes serverless ideal for this scenario?
Next up: The key benefits of cloud computing — high availability, scalability, and why the cloud is more reliable than your own data centre.