Pay only for what you use—turn flat-fee services into variable costs that scale with demand
Traditional cloud services like App Service and always-on virtual machines charge a flat monthly fee regardless of usage. If your application only handles traffic during business hours or has unpredictable spikes, you're paying for idle capacity.
Serverless and consumption-based services like Azure Functions and Container Apps flip this model—you pay per execution, per second of CPU time, or per request. When there's no traffic, you pay nothing (or near-nothing).
For CFOs, this is a dream: variable costs that directly correlate with business activity. When revenue drops, costs automatically drop. When demand spikes, you pay more but you're also earning more.
| Model | Pricing | Cost When Idle | Best For |
|---|---|---|---|
| Flat-Fee (App Service Standard S1) |
$73/month regardless of usage |
$73/month (100% cost) |
Constant traffic, predictable load |
| Consumption (Azure Functions) |
$0.20 per million executions + $0.000016/GB-second |
$0/month (0% cost) |
Intermittent traffic, unpredictable spikes |
| Scale-to-Zero (Container Apps) |
$0.000024/vCPU-second + $0.0000025/GiB-second |
$0/month (0% cost) |
Microservices, event-driven apps |
This is a hypothetical, illustrative example for teaching purposes, not an actual case study.
Your company runs an internal HR API used by web and mobile apps. It handles employee lookups, time-off requests, and expense submissions. Traffic is concentrated during business hours (8 AM - 6 PM weekdays), with minimal usage nights and weekends.
Option 1: Azure Functions (Consumption Plan)
Option 2: Container Apps (Consumption)
Winner: Azure Functions still saves the most for this workload ($770/year, 88% reduction), but with a realistic ~220 business-hours/month usage figure, Container Apps is now competitive too—$137.81/year, an 84% reduction versus App Service. Both consumption options are dramatically cheaper than the flat-fee App Service plan; Functions' per-execution billing has a slight edge for short-duration requests like this one, but Container Apps is a reasonable choice if you need container portability or plan to run other workloads on the same environment.
If your API had constant high traffic (e.g., 50 million requests/month running near 24/7), Functions would cost ~$88/month ($1,056/year) while App Service Standard S1 stays at $876/year. At high utilization, flat-fee becomes cheaper.
Rule of thumb: Consumption pricing wins when idle time > 40% or when traffic is unpredictable. Flat-fee wins when running near-constantly at steady load.
Let's scale this up: Your company has 12 similar APIs and background jobs running on App Service. Migrating 8 of them (the ones with intermittent traffic) to Azure Functions would save $6,160/year ($770 × 8).
Real-world company: $12M annual revenue, 200 employees
| Line Item | Before Serverless | After Serverless | Change |
|---|---|---|---|
| Revenue | $12,000,000 | $12,000,000 | — |
| Cost of Goods Sold | $1,800,000 | $1,800,000 | — |
| Gross Profit | $10,200,000 | $10,200,000 | — |
| Gross Margin % | 85.0% | 85.0% | — |
| Operating Expenses | |||
| Salaries & Benefits | $7,200,000 | $7,200,000 | — |
| Cloud Infrastructure | $780,000 | $773,840 | -$6,160 |
| Sales & Marketing | $720,000 | $720,000 | — |
| General & Administrative | $360,000 | $360,000 | — |
| Total Operating Expenses | $9,060,000 | $9,053,840 | -$6,160 |
| EBIT (Operating Income) | $1,140,000 | $1,146,160 | +$6,160 |
| Operating Margin % | 9.5% | 9.6% | +0.1pp |
Key insight: While $6,160 seems small for a $12M company, serverless also adds operational resilience—automatic scaling during traffic spikes means you don't need to over-provision capacity "just in case." CFOs love this because it eliminates waste from idle resources while maintaining flexibility.
| Service | Best For | Pricing Model | Cold Start |
|---|---|---|---|
| Azure Functions (Consumption) |
Event-driven code, APIs, scheduled jobs |
Per execution + GB-seconds |
0.5-3 sec (HTTP trigger) |
| Container Apps (Consumption) |
Microservices, containerized workloads |
Per vCPU-second + GiB-second |
1-5 sec (scale from zero) |
| Logic Apps (Consumption) |
Workflow automation, integrations |
Per action executed + connector calls |
Minimal (managed service) |
| API Management (Consumption) |
API gateway, dev/test APIs |
Per million calls | Minimal (managed service) |
| Azure SQL (Serverless) |
Dev/test databases, intermittent workloads |
Per vCore-second + storage |
~3 sec (auto-pause/resume) |
Phase 1: Identify Candidates (Week 1-2)
Phase 2: Pilot Conversion (Week 3-4)
Phase 3: Scale Rollout (Month 2-3)
Consumption pricing is powerful but requires active monitoring. Without visibility, a runaway function can generate millions of executions and surprise you with a massive bill.
Mitigation: Set daily spending limits in Azure Cost Management and configure alerts at 50%, 80%, 100% of budget.
The problem: "Consumption plan has a free tier of 1 million executions, so our API is free!"
Reality: You still pay for compute time (GB-seconds). A "free" API with 1M requests at 500ms each and 512 MB memory = 250,000 GB-seconds × $0.000016 = $4.00. Not free, but very cheap.
The problem: User-facing web app experiences 3-second delays on first request after idle period.
Fix: Either accept the trade-off (if cost savings justify it), use Premium Plan with pre-warmed instances (costs more but eliminates cold start), or keep a warmup timer trigger pinging the function every 5 minutes.
The problem: "Serverless is cheaper, let's migrate our entire platform!"
Reality: High-traffic always-on services are more expensive on consumption pricing. A 24/7 API handling constant traffic should stay on App Service or dedicated compute.
The problem: Function takes 5 seconds to process when it could take 500ms with better code.
Impact: You're paying 10x more per execution. Optimize aggressively: reduce dependency loading, cache configuration, use connection pooling, parallelize I/O operations.
| Factor | Azure Functions | Container Apps |
|---|---|---|
| Best For | Short-lived event-driven tasks | Containerized microservices |
| Execution Model | Per-function invocation | Long-running HTTP/gRPC services |
| Cold Start | 0.5-3 seconds | 1-5 seconds |
| Max Timeout | 10 minutes (consumption) | Unlimited |
| Pricing | Cheaper for short bursts | Cheaper for sustained runtime |
| Language Support | C#, JavaScript, Python, Java, PowerShell | Any language (containerized) |
| Built-in Triggers | HTTP, Timer, Queue, Blob, Event Hub, etc. | HTTP, gRPC, KEDA-based (custom) |
| Complexity | Simpler (managed runtime) | More control (BYO container) |
Rule of thumb:
When presenting serverless migration to leadership, emphasize financial flexibility. This is your talking track:
"We can reduce infrastructure costs by migrating intermittent workloads to consumption-based pricing."
Key CFO benefit: "This converts fixed costs into variable costs that correlate with business activity. During slow periods or recessions, our infrastructure spend automatically decreases."
Continue your learning journey