CodeMIRAI
0 XP

The consumption-based model, pricing models and serverless

2 min read Quiz included

Buying servers and paying for cloud services are two very different ways of spending money. AZ-900 expects you to know both terms and which one the cloud uses.

CapEx and OpEx

  • Capital expenditure (CapEx) is a large, up-front spend on physical things that you own and that lose value over time: buying servers, building a data centre.
  • Operational expenditure (OpEx) is ongoing spending on services you use, billed as you go: electricity, staff, and cloud services.

Moving to the cloud shifts spending from CapEx to OpEx. You no longer buy hardware; you pay for computing as an operating cost.

TimeCapacity and costServers bought up front (CapEx)Another big purchasePaid for, never usedCloud: pay for what you use (OpEx)On-premises capacityCloud costDemand (dashed)
On-premises, you buy for the peak you expect and pay for the gap. In the cloud, cost follows demand.

The consumption-based model

Cloud providers use a consumption-based model: you pay only for the resources you use, when you use them.

  • No up-front cost. Nothing to buy before you start.
  • No wasted capacity. You do not pay for servers that sit idle "just in case".
  • Pay for more when you need more. Busy month? You pay more. Quiet month? You pay less.
  • Stop paying when you stop using. Delete a resource and its charges stop.

Cloud pricing models

Pay-as-you-go is the default, but it is not the only way to buy cloud capacity. The more you can commit to, the less you pay per hour.

ModelHow it worksBest for
Pay-as-you-gobilled per second, minute or hour of use, with no commitmentunpredictable, short-term or new workloads
Reservations (reserved instances)commit to a specific resource, such as a VM size in a region, for one or three years, in return for a large discountsteady workloads that won't change for years
Savings plan for computecommit to spend a fixed amount per hour on compute for one or three years; the discount follows your usage across VM sizes, regions and servicessteady spending on compute that changes shape over time
Spot pricinguse spare capacity at a deep discount; Azure can take it back (evict it) at short noticeinterruptible work such as batch jobs and tests

Two more ways to pay less are worth knowing:

  • Azure Hybrid Benefit lets you bring existing Windows Server and SQL Server licences (with Software Assurance) to Azure, so you don't pay for the licence twice.
  • Free tiers and the free account: many services have an always-free allowance.

Serverless

Serverless computing means you run code without managing servers at all. The provider runs, scales and maintains the infrastructure; you deploy the code and pay for what it uses.

What makes something serverless:

  • No infrastructure to manage: no VMs to size, patch or keep running.
  • Event-driven: code runs in response to an event (a file upload, an HTTP request, a message, a timer).
  • Automatic scaling, including down to zero when nothing is happening.
  • Pay per execution: you are billed for the work done, not for idle servers.

Azure examples:

  • Azure Functions runs small pieces of code in response to events.
  • Azure Logic Apps runs automated workflows that connect apps and services, often with little or no code.
  • Azure Container Apps runs containers serverlessly, scaling them with demand.

Servers still exist, of course. "Serverless" means they are entirely the provider's problem.

Finished this lesson?Mark it complete to earn +20 XP and move your progress on.