Skip to content
CAMPUX
Field notes · Cost
Azure Spot VMs

Azure Spot VMs, explained: what they are, how the pricing works, and when the discount is worth it

By 15 min readUpdated Sep 2026

A Spot VM is the same hardware as a standard VM at a fraction of the price, with one catch: Azure can take it back on 30 seconds' notice. Here is how the pricing actually works, how to read the eviction rate before you commit, and the one question that decides whether the discount is a bargain or a trap.

New to cloud? CAMPUX is a free, build-first course. Start here →

An Azure Spot VM is an ordinary virtual machine running on Azure's unused capacity, sold at a steep, variable discount — Microsoft's own marketing says up to 90 percent off pay-as-you-go — on the condition that Azure can evict it with 30 seconds' notice whenever it needs the capacity back, or whenever the live price rises above the maximum you set. There is no SLA. It is the right tool for work that can be interrupted and resumed, and the wrong tool for anything where a vanished machine is an outage.

Microsoft is blunt about the mechanism: Spot VMs use unused capacity at a significant cost saving, and "at any point in time when Azure needs the capacity back, the Azure infrastructure will evict Azure Spot Virtual Machines" with 30 seconds' notice. You are renting the seats nobody bought, and the moment a paying customer wants them, you are asked to leave. The discount is not free money. It is payment for accepting interruption, and everything below is working out whether your workload can afford to accept it.

What a Spot VM actually is

A Spot VM is a normal Azure virtual machine placed on spare capacity in a datacentre. Same sizes, same images, same disks, same networking. Microsoft's own answer to "is it the same as a regular VM once it is running" is yes, except there is no SLA and it can be evicted at any time. The reason it is cheap is the reason it is fragile: you get to use the hardware only while nobody with a full-price allocation needs it.

You are renting the seats nobody bought. The discount is the airline paying you to give up your seat the instant a full-fare passenger shows up.

Spot VMs are surplus capacity at up to ~90% off, but Azure can evict them on 30 seconds notice.on-demandfull pricespotup to ~90% offeviction30-second noticereclaimed anytimecheap surplus capacity — for batch, CI, and stateless or checkpointed work
Figure 1 — Spot VMs sell Azure's spare capacity at a steep discount, with one catch: Azure can reclaim them whenever it needs the capacity back, giving 30 seconds' notice. So they are ideal for interruptible, restartable work — batch jobs, CI runners, rendering, dev boxes, anything that checkpoints — and wrong for stateful, always-on services. Set a max price and an eviction policy, and design the job to resume where it left off.

How Azure Spot pricing works

This is the part people search for and the part most guides wave past. Spot pricing is variable: it moves with supply and demand for spare capacity, and it differs by region and by VM size. There is no fixed Spot price for a given size, which is why you cannot look it up on a static sheet the way you can a reserved rate.

Three things follow from that.

You set a maximum price, and it is a cap rather than a bid. When you create the VM you name the most you will pay per hour, in US dollars to five decimal places — 0.98765 is a cap of $0.98765 an hour. The machine deploys only if that cap is at or above the current Spot price, and if the price later rises above it, the machine is evicted. You pay the current Spot rate, not your cap, so setting it higher does not cost you more; it only widens the band in which you keep the machine.

Setting the max price to -1 removes price evictions entirely. With -1, the VM is never evicted for pricing reasons. You pay whichever is lower, the current Spot price or the standard pay-as-you-go price, so you can never be charged more than a normal VM. For most workloads this is the right setting: it means the only thing that can take the machine away is Azure needing the capacity back, which nothing removes.

Changing the cap later needs a deallocate first. You cannot adjust the max price on a running Spot VM. Deallocate it, set the new price, then start it again. And a VM that was evicted because the price rose does not restart on its own when the price falls back — you restart it yourself, and it is charged at whatever the current price is then.

Reading the price and the eviction rate before you commit

The portal shows you both while you are creating the VM. Tick Run with Azure Spot discount, and a link appears under the size selector to view pricing history and compare nearby regions, as a chart or a table. The eviction rate shown there is quoted per hour: a figure of 10 percent means the machine has roughly a one-in-ten chance of being evicted in the next hour, based on the last seven days. A quieter region or a less popular size often gives you a lower rate for a similar price, and the create screen lets you switch right there.

If you want it programmatically, Azure Resource Graph exposes the last 90 days of Spot prices and the last 28 days of eviction rates in the SpotResources table, so you can query across sizes and regions and pick the combination with the best price for the eviction risk you can tolerate. The Azure retail prices API also returns Spot rates; the meter and SKU names both contain the word Spot.

How much you actually save

Microsoft's marketing says up to 90 percent off pay-as-you-go, and in practice most Spot VMs land somewhere between 60 and 90 percent off. But because the price floats, the saving is not a constant: when demand for spare capacity in a region is high, the discount on a popular size can shrink to a third or less. Treat the headline figure as the ceiling, read the current price for your size in your region before you plan around a number, and expect it to move.

Where Spot sits against the other ways to pay for compute
Pay-as-you-goReserved instance / savings planSpot
PriceList rate, by the secondDiscounted for a one- or three-year commitmentVariable, typically the deepest discount
CommitmentNoneOne or three yearsNone
SLAYesYesNone
Can Azure take it away?NoNoYes, on 30 seconds' notice
Best forUnpredictable, short-lived, or new workloadsSteady, always-on workloads you can forecastInterruptible work that can resume

The rows are not competitors. A mature estate uses all three: reservations for the steady base, pay-as-you-go for the unpredictable edge, and Spot for the batch and build work that can tolerate being bumped.

Eviction: what triggers it, and what happens next

Two things evict a Spot VM. Azure needs the capacity back for pay-as-you-go workloads, or the live Spot price rises above your max price. A -1 cap removes the second; nothing removes the first. When eviction is coming you can opt in to a heads-up through Azure Scheduled Events, delivered on a best-effort basis up to 30 seconds before the machine goes. Thirty seconds is enough to flush a checkpoint or drain a queue. It is not enough to shut down a database gracefully.

What happens to the machine is decided by the eviction policy you chose at creation.

The rule of thumb: Deallocate when the machine holds a configured environment you want back, Delete for disposable workers where a scale set will spin up a replacement. Scale sets are the natural home for Spot for exactly that reason — they treat every node as replaceable and keep refilling the pool as instances come and go.

Which workloads fit, and which never do

Spot rewards work that is interruptible and can resume from where it stopped. Microsoft points at batch processing, dev and test environments, and large compute jobs. In practice the good fits are batch and rendering, where a lost chunk just re-runs; CI/CD runners, where a build agent that dies is retried on a fresh one; dev and test boxes, where an evicted sandbox is an inconvenience rather than an incident; stateless, horizontally scaled workers that hold no unique state; and checkpointable jobs such as model training or simulations that save progress to durable storage and pick up from the last checkpoint.

The list of what must never run on Spot is shorter and firmer: production databases, anything holding state on the local disk, the customer-facing web tier, message brokers, domain controllers, and any always-on service where a 30-second eviction is an outage. Microsoft's own guidance for anyone who gets evicted and still needs the capacity is to use standard VMs instead. If the answer to "what happens when this machine vanishes right now?" is anything worse than "it comes back and retries", keep it off Spot.

The limits that catch people

Before you flip the Spot switch

Test the failure, not just the happy path. Azure lets you simulate an eviction on demand, so you can prove your job actually checkpoints and resumes before you trust real money to it. Pair a -1 max price with a Delete policy on stateless workers for the cleanest, cheapest setup, and put the workers in a scale set so the pool refills itself.

The honest verdict

Spot VMs are one of the largest discounts in the cloud, and they are worth it exactly when your workload treats a lost machine as a retry rather than a disaster. For batch, CI, dev and test, and stateless compute that checkpoints its progress, running on Spot can cut the compute line of a bill hard, and it belongs in the same toolbox as the other moves in cutting an Azure bill. For anything stateful or always-on, the discount is a trap: you save pennies until the eviction that costs you an outage.

Ask one question before you choose Spot: if this machine disappears in 30 seconds with no warning, is that a retry or an incident? If it is a retry, take the discount, set a -1 max price, and pick Deallocate or Delete to match how disposable the box is. If it is an incident, stay on standard or reserved VMs. Price the interruption honestly and Spot is close to free money. Misjudge it and it is the most expensive cheap VM you will ever run.

Questions people also ask

What is an Azure Spot VM?

An ordinary Azure virtual machine that runs on unused datacentre capacity at a steep, variable discount, on the condition that Azure can evict it with 30 seconds' notice whenever it needs the capacity back or the price rises above your cap. Once running it is identical to a standard VM in every way except that it has no SLA and can be taken away at any time.

How does Azure Spot pricing work?

The price is variable, moving with supply and demand for spare capacity, and differs by region and VM size. You set a maximum price per hour to five decimal places; the VM deploys only if that cap is at or above the current price and is evicted if the price rises above it. You are charged the current Spot rate, not your cap. Setting the cap to -1 removes price evictions and charges you the lower of the Spot price and the standard price, so you never pay more than a normal VM.

How much do Azure Spot VMs cost, and how much do they save?

Microsoft's marketing says up to 90 percent off pay-as-you-go, and most Spot VMs land between roughly 60 and 90 percent off. Because the price floats, the saving shrinks when demand for spare capacity is high, sometimes to a third or less on popular sizes. The portal shows the current price and historical eviction rate for a size in a region while you create the VM, and Azure Resource Graph exposes 90 days of price history for programmatic comparison.

Can an Azure Spot VM be evicted?

Yes, and you should design for it. Azure reclaims a Spot VM whenever it needs the capacity back for pay-as-you-go workloads, or when the live price rises above your max price. You get a best-effort heads-up of up to 30 seconds through Scheduled Events. A max price of -1 stops price evictions, but nothing stops capacity evictions.

What is the difference between Deallocate and Delete eviction policies?

Deallocate, the default, stops the VM so you can try to restart it later, but the machine keeps counting against your quota and you keep paying for its disks, and there is no guarantee a restart finds capacity. Delete removes the VM and its disks together, so storage charges stop and nothing is kept. Use Deallocate for an environment you want back and Delete for disposable workers a scale set will replace.

What is the difference between a Spot VM and a Reserved Instance?

A reserved instance is a one- or three-year commitment on standard capacity with a guaranteed SLA and no eviction risk, for predictable always-on workloads. A Spot VM rents spare capacity at a deeper discount with no SLA and eviction on 30 seconds' notice, for interruptible work. Mature estates use both: reservations for the steady base, Spot for batch and build work.

Which workloads should never run on Spot VMs?

Anything where a 30-second eviction is an outage: production databases, message brokers, domain controllers, the customer-facing web tier, and anything holding unique state on the local disk. If you need capacity right now with a guarantee it stays, use standard or reserved VMs. B-series burstable sizes and promotional sizes are not supported on Spot at all.

Further reading — the Microsoft docs
Your next class · free
You've read the idea. Class 32 — Cost Management & FinOps is where you build it, hands-on — no account needed.Start Class 32 →
Captain O
Founder & instructor · CAMPUX Cloud Engineering Bootcamp
LinkedIn
Back to all field notes →