Skip to content
CAMPUX Cloud Bootcamp
Field notes · Azure · Compute decision
Azure · IaaS vs PaaS

Azure VM vs App Service — which should you use?

By Captain O8 min read

Same web app, two very different machines to run it on. One hands you the whole box and the bill of responsibilities that comes with it. The other hands you a place to put your code and takes the rest.

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

Choose App Service (PaaS) when you just want to run a web app or API and let Microsoft own the OS, the patching, and the scaling — that's the right default for most web workloads. Choose a Virtual Machine (IaaS) when you need full control of the machine: a custom runtime, a background service, non-HTTP ports, GPU or kernel-level work, or software App Service simply can't host. The honest catch: a VM's lower entry looks simpler, but you inherit every patch, every hardening step, and every 3 a.m. security update for the life of the box.

This is the IaaS-versus-PaaS decision made concrete, inside one cloud, for the one thing beginners build first: a web app that needs somewhere to live. If the abstract layers — infrastructure, platform, software — are still fuzzy, spend ten minutes on the IaaS/PaaS/SaaS class first, then come back. The rest of this note assumes you know the app runs; the question is what it runs on.

The one-line difference

A Virtual Machine is a computer Azure rents you. It boots an operating system you chose, and from the moment it's yours, everything above the hypervisor is your problem: the OS updates, the web server, the runtime, the firewall rules, the certificates, the logging. Azure keeps the physical hardware alive. You keep the machine alive.

App Service is a managed home for a web app. You hand it your code — a container, a zip, a Git push — and it runs on a fleet Microsoft patches, secures, load-balances, and scales for you. You never see the OS. You never apt upgrade anything. You get HTTPS, a deployment slot, autoscale, and health checks as features, not as things you build. In exchange, you give up the ability to do anything the platform doesn't expose.

A VM gives you the whole machine. App Service gives you a place for your app and keeps the machine to itself.

The over-reach that costs beginners

Here is the pattern I watch new engineers fall into, because it's the one I fell into. You come from a world where "get a server" is how you deploy anything. So you spin up a VM, SSH in, install the runtime, configure nginx, open a port, and feel like a real engineer. It works. You ship.

Then the invoice of ownership arrives, and it isn't dollars. It's a Ubuntu security advisory you now have to apply. It's a TLS certificate that expires and takes your site down at midnight because nothing renewed it. It's an open SSH port that a botnet finds within the hour. It's the realization that your "simple" web app now sits on a machine that is entirely your responsibility to keep patched, hardened, and monitored — for a workload that never needed a machine in the first place.

App Service would have given you HTTPS, certificate renewal, patched hosts, and no exposed SSH port on day one, for the same money. The VM didn't buy you power you were using. It bought you a maintenance job you didn't know you'd signed for. That's the tax on reaching for IaaS out of habit — and it's the single most common wrong turn in early Azure work.

VM vs App Service, side by side

Azure Virtual Machine (IaaS) vs Azure App Service (PaaS) — the working differences
 Azure Virtual Machine (IaaS)Azure App Service (PaaS)
What you manage OS, patching, runtime, web server, firewall, certificates, logging, backups — everything above the hypervisor. Your code and its config. Microsoft owns the OS, host patching, TLS, and the platform.
Scaling You build it — scale sets, a load balancer, health probes, and the automation to add or remove instances. Built in. Scale up (bigger plan) or out (more instances) with a slider or an autoscale rule.
Cost model Pay for the VM size per second it runs, plus disks, plus egress — whether the app is busy or idle. No permanent free tier. Pay for the App Service Plan tier. A genuinely free tier exists for small/low-traffic apps; paid tiers add scale, slots, and custom domains.
Deployment Your responsibility: SSH/RDP in, or build image + config management (Bicep, Ansible, cloud-init) to make it repeatable. Git push, zip deploy, container pull, or CI/CD in a few clicks. Deployment slots for zero-downtime swaps.
When it's the right call Custom OS/runtime, non-HTTP ports, background daemons, GPU/kernel work, licensed software that installs on a box, or lift-and-shift of an existing server. A standard web app or HTTP API in a supported stack (.NET, Node, Python, Java, PHP, or a container) where you want to ship, not sysadmin.
Migration path From App Service to a VM later is a clean re-platform — install the same runtime on a box you now own. From a hand-built VM to App Service is harder — you must untangle everything installed on the machine.

When a VM is genuinely the right answer

None of this is "never use a VM." A VM is the correct tool the moment your requirement lives outside what the platform exposes. Reach for IaaS when:

For everything else — the CRUD app, the REST API, the marketing site, the internal tool — App Service is the better default. It's not the "beginner" option and the VM the "advanced" one. It's the opposite: reaching for a VM you don't need is the beginner move, and knowing you don't need it is the skill.

The default, stated plainly

Start on App Service. Drop to a VM only when a concrete requirement — a port, a runtime, a piece of software, an OS-level need — forces your hand. Making a web app a VM's problem means inheriting patching and security you get for free on PaaS, for no benefit your app was using. The whole discipline of the compute decision is refusing power you don't need.

How the money compares

People assume the VM is cheaper because you can pick a tiny size. On the sticker, a small VM and a comparable App Service plan land in the same neighborhood per month — the pricing models differ but the order of magnitude doesn't. Where they diverge is total cost of ownership. The VM's real price includes the hours you spend patching, hardening, wiring up deployment, and building the scaling that App Service ships for free. That labor is invisible on the invoice and very visible in your week.

There's also a floor difference worth knowing. App Service has a free tier that will host a small, low-traffic app indefinitely — useful for a portfolio project or a demo. A VM has no permanent free equivalent; past the 12-month intro allowance and the standard $200 / 30-day new-account credit, a running VM bills for every second it's on, idle or not. If cost is the whole question for a tiny project, the managed tier usually wins. Prices and tiers shift — check the Azure pricing calculator before you commit, and if you're comparing across clouds, our cheapest cloud for small projects teardown goes deeper than I will here.

Certified vs. actually being able to choose

Every cert curriculum can define IaaS and PaaS. Far fewer teach you to make this call under real constraints — where the wrong choice shows up months later as a patching backlog or a bill nobody can explain. The job-ready skill isn't reciting that App Service is "platform as a service." It's walking into a design conversation and saying "this is a plain web API, it goes on App Service, and here's the one requirement that would change my mind." That sentence is worth more than the definition, and it's the thing we drill. Build the muscle properly in the compute class, then get hands-on with each in App Service and Virtual Machines — deploy the same app both ways once, and the decision stops being abstract.

Common questions

Is App Service cheaper than a VM?

Not always on the sticker, but usually cheaper to own. App Service and a comparable VM cost roughly the same per month at a given size, but the VM adds the hidden bill: your time patching the OS, hardening it, and building the deploy and scaling you get for free on App Service. There's also a genuinely free App Service tier for small sites; a VM has no permanent free equivalent past the 12-month intro credit. Prices change — check the Azure pricing calculator.

Can App Service run background jobs or a non-HTTP service?

Partly. App Service is built for HTTP web apps and APIs. It can run scheduled background work through WebJobs, and event-driven jobs belong on Azure Functions. But if you need a long-running process that listens on an arbitrary TCP port, a custom daemon, or software that isn't a web app, that's a VM job — App Service only exposes HTTP and HTTPS.

When should I use a VM instead of App Service in Azure?

Use a VM when you need control App Service can't give you: a custom OS or runtime, kernel-level or GPU workloads, software that installs on the machine rather than deploying as a web app, non-HTTP ports, or a lift-and-shift of an existing server. If your app is a standard web app or API in a supported stack, App Service is the better default and a VM is over-reach.

Can I move from App Service to a VM later?

Yes, and the direction matters. Starting on App Service and moving to a VM later is a clean re-platform — you take the same code and install its runtime on a machine you now own. Going the other way, from a hand-built VM to App Service, is usually harder because you have to untangle everything you installed on the box. Start with the managed option; drop to a VM only when a real requirement forces it.

Read next
Your next class · free
You've read the idea. Class 11 — The compute decision is where you build it, hands-on — no account needed.Start Class 11 →
Captain O
Founder & instructor · CAMPUX Cloud Engineering Bootcamp
Filed under Azure · Compute decision. Next note: Azure VM vs AWS EC2 — the cross-cloud version →