Decision framework: how to choose the right hosting service
Choosing between Azure App Service, Azure Virtual Machines (VMs), and Azure Container Apps is mainly a trade-off between how much control you need and how much operational work you want to keep. Use the framework below to decide based on workload type, operational responsibility, scaling needs, and budget.
Step 1: Classify the workload type
- Static site: mostly HTML/CSS/JS, maybe calling an API.
- API: REST/GraphQL backend, stateless preferred.
- CMS: WordPress/Drupal/custom CMS, often needs file storage + database + scheduled tasks.
- Legacy app: requires specific OS settings, older frameworks, COM components, custom drivers, or special installers.
- Containerized app / microservices: already packaged as containers, multiple services, event-driven scaling.
Step 2: Decide how much you want Azure to manage
Ask: “Do we want to manage servers?” If the answer is “no,” start with App Service or Container Apps. If you must control the OS, you are in VM territory.
Step 3: Define scaling needs
- Predictable traffic: steady load, simple scale-out rules.
- Spiky traffic: sudden bursts (marketing campaigns), benefit from fast scale-out and possibly scale-to-zero for background services.
- Many small services: microservices, independent scaling per service.
Step 4: Budget model
- App Service: pay for an App Service Plan (reserved compute). Cost is stable; you can scale up/down by changing plan size or instance count.
- VMs: pay per VM size and uptime; extra costs for disks, backups, and operational time. Often more expensive when you include management overhead.
- Container Apps: often consumption-based for active usage (depending on configuration), can be efficient for bursty workloads and multiple small services.
What Azure manages vs what you manage
Use this section as a checklist for operational responsibility. The same workload can be “cheap” or “expensive” depending on who patches, who scales, and who handles certificates.
Azure App Service (Web Apps)
Best fit: standard web apps and APIs where you want managed hosting with minimal server administration.
- Azure manages: underlying host infrastructure; OS maintenance for the platform; built-in load balancing within the plan; platform availability; many runtime stacks (depending on OS); integration points for managed certificates and deployment slots.
- You manage: application code and dependencies; app configuration (settings, connection strings); choosing runtime/stack version; scaling rules (manual or autoscale); TLS certificates and bindings (even if Azure can help automate, you still own the decision and lifecycle); application-level monitoring and alerting; access control to the app.
- OS patching: Azure handles the platform OS; you do not patch the server OS.
- Runtime: you select supported runtimes; you update your app to remain compatible.
- Scaling: you configure scale up/out; Azure executes it.
- Certificates: you configure and renew/rotate (or use managed options where available); Azure applies them to the service.
- Networking: you configure service-level access restrictions and integrations; Azure runs the underlying network fabric.
Azure Virtual Machines
Best fit: full control, custom OS configuration, legacy stacks, or software that cannot run in App Service/Container Apps.
Continue in our app.
You can listen to the audiobook with the screen off, receive a free certificate for this course, and also have access to 5,000 other free online courses.
Or continue reading below...Download the app
- Azure manages: physical datacenter, hardware, and virtualization layer; VM availability options; basic host maintenance.
- You manage: the entire guest OS (Windows/Linux); OS hardening; patching; runtime installation and updates; web server configuration (IIS/Nginx/Apache); application deployment; scaling architecture (multiple VMs, load balancing approach); backups strategy; certificates on the OS/web server; security tooling and malware protection; disk sizing and performance tuning.
- OS patching: you patch the guest OS and installed components.
- Runtime: you install and maintain any runtime/framework and supporting libraries.
- Scaling: you design it (e.g., add VMs, configure autoscale, handle session state, shared storage).
- Certificates: you install and renew on the VM/web server (or automate via tooling).
- Networking: you configure VM-level access (NSGs, routes, etc.) and keep the OS firewall aligned with your design.
Azure Container Apps
Best fit: containerized APIs, background workers, microservices, and event-driven workloads where you want managed scaling without managing Kubernetes directly.
- Azure manages: the underlying orchestration platform; scheduling and health management; scaling mechanisms; ingress integration (when enabled); platform OS and node maintenance.
- You manage: container images (build, scan, version); container configuration (environment variables, secrets); resource sizing per app; scaling rules (HTTP concurrency, CPU, events); observability setup; certificate choices for custom domains (depending on features used).
- OS patching: Azure patches the host nodes; you keep your container base images updated.
- Runtime: your runtime is inside the container; you update it by shipping a new image.
- Scaling: you define scaling rules; the platform scales replicas and can scale down aggressively.
- Certificates: you configure custom domains and certificate lifecycle based on your chosen approach.
- Networking: you configure ingress exposure and service-to-service access patterns; Azure runs the underlying network.
Comparison: choosing the right service by common web-hosting patterns
When App Service is best for standard web apps
Choose App Service when you want to deploy a typical website or API quickly with minimal infrastructure work.
- Good matches: ASP.NET/Node/Python/PHP web apps; REST APIs; marketing sites with dynamic components; internal line-of-business apps.
- Why it wins: fast setup; managed platform; straightforward scaling; deployment slots for safer releases; easy integration with managed identity and configuration patterns.
- Watch-outs: if you need OS-level customization (custom drivers, special installers, nonstandard services), App Service may not fit; if you need very specific networking patterns or low-level control, you may outgrow it.
When VMs are required for full control or legacy stacks
Choose VMs when the application requires control that a managed platform cannot provide.
- Good matches: legacy .NET Framework apps requiring full IIS features; apps needing COM components; custom Windows services; specialized Linux daemons; vendor software that requires an installer and machine-level configuration; applications needing custom reverse proxy modules.
- Why it wins: maximum flexibility; you can install anything supported by the OS; you control patch cadence and system settings.
- Watch-outs: higher operational burden; you must design for scaling and resilience; patching and security are your responsibility; cost includes both compute and the time to operate it.
When Container Apps fit microservices or containerized APIs
Choose Container Apps when you have containers (or want to adopt them) and need managed scaling and service isolation without running your own Kubernetes cluster.
- Good matches: containerized APIs; multiple small services that scale independently; background workers; event-driven processing; workloads with bursty traffic.
- Why it wins: deploy by image; scale per service; good for polyglot stacks; encourages immutable deployments (new image = new release).
- Watch-outs: you need a container build pipeline; you must manage image security and base image updates; stateful workloads typically require external state (database/storage) rather than local container storage.
Practical step-by-step: apply the framework to a real decision
Use the following steps each time you evaluate a web hosting workload. Write down the answers; the “best” option usually becomes obvious.
Step 1: List hard requirements (non-negotiables)
- Does it require a specific OS version or machine-level installation? If yes, lean toward VMs.
- Is it already delivered as a container image (or must be)? If yes, lean toward Container Apps.
- Can it run on a managed runtime without OS access? If yes, lean toward App Service.
Step 2: Identify state and dependencies
- If the app is stateless (API, front-end), it’s ideal for App Service or Container Apps.
- If it needs local disk state or server-bound components, it often pushes you toward VMs (or a redesign).
- For CMS workloads, check whether the CMS expects writable local files; plan for shared storage or a design that avoids local state if you want easy scale-out.
Step 3: Decide the scaling approach
- Need simple scale-out of one web app? App Service is usually simplest.
- Need independent scaling of multiple services and fast burst handling? Container Apps is often a better match.
- Need custom scaling logic tied to OS-level metrics or custom components? VMs provide the most control (with more work).
Step 4: Assign operational ownership
- If your team cannot commit to OS patching and server hardening, avoid VMs unless required.
- If you can manage container images and CI/CD, Container Apps can reduce infrastructure work while keeping portability.
- If you want the simplest operational model for a single web app, choose App Service.
Step 5: Estimate cost drivers
- App Service: cost mainly driven by plan size and instance count; good for steady workloads.
- VMs: cost driven by VM size, uptime, disks, and operational overhead; can be cost-effective for specialized needs but rarely “cheapest” when fully managed by a small team.
- Container Apps: cost driven by active usage and scaling behavior; can be efficient for spiky traffic and many small services.
Mini-exercises: choose the right service (small-to-medium scenarios)
For each scenario, pick App Service, Virtual Machines, or Container Apps. Then justify your choice using: workload type, operational responsibility, scaling needs, and budget model. After choosing, answer the “What do you manage?” checklist items.
Scenario 1: Small business brochure site + contact form
A local business needs a simple website with a contact form that sends emails. Traffic is low and predictable. The team has no server admin experience and wants minimal maintenance.
- Your choice: ________
- Justify: Is this a standard web app? Do you need OS access?
- Checklist: Who manages runtime updates? Who manages TLS certificate renewal?
Scenario 2: Public REST API with bursty traffic
A startup exposes a REST API used by a mobile app. Traffic spikes during certain hours and after marketing pushes. The API is stateless and already packaged as a Docker image.
- Your choice: ________
- Justify: How important is rapid scale-out? Is container deployment a requirement?
- Checklist: What do you update to patch the runtime (OS vs container base image)?
Scenario 3: WordPress CMS for a regional magazine
A magazine runs WordPress with plugins, scheduled jobs, and frequent content updates. They expect moderate traffic and want easy management, but they also need the site to handle occasional spikes when an article goes viral.
- Your choice: ________
- Justify: Do you prefer managed hosting? How will you handle scale-out with a CMS that writes files?
- Checklist: Who manages PHP/runtime updates? How will you approach scaling without breaking uploads/media?
Scenario 4: Legacy .NET Framework app with COM dependency
An internal application runs on .NET Framework and requires a COM component installed on the server. The vendor provides a Windows installer and requires specific IIS modules and machine-level configuration.
- Your choice: ________
- Justify: Is OS-level installation required? Can a managed platform support the dependency?
- Checklist: Who patches Windows and IIS? Who installs and renews certificates?
Scenario 5: Microservices for an e-commerce backend
An e-commerce team has 6 small services (catalog, cart, pricing, checkout, notifications, and a worker). Each service is containerized. Some services need to scale heavily (checkout), others rarely (notifications). The team wants independent scaling and straightforward deployments.
- Your choice: ________
- Justify: Do you need per-service scaling? Do you want to avoid managing Kubernetes nodes?
- Checklist: What do you manage for security updates (images)? How do you define scaling rules per service?