Microsoft Azure Learning Journey

App Service or Functions? Choose Your Azure Hosting Model

Match the execution model to the application: always-on web app, event handler, container, cluster, or VM.

5 min read · 982 words
Microsoft AzureAzure ComputeContainersCloud ArchitectureDevOps
App Service or Functions? Choose Your Azure Hosting Model cover image

A team puts a scheduled data task on an always-on web server, then pays for idle capacity. Another team splits a stateful web application into dozens of functions and spends more time coordinating triggers than shipping features. The right Azure hosting service follows the workload’s lifecycle and operational needs.

What you’ll learn

Where this fits

Module 18, Phase 4, Part 5. Next: Ship a Containerized API to Azure Container Apps.

Prerequisites

The hosting model is an operational contract

Azure App Service

App Service hosts web apps, mobile back ends, and REST APIs on a managed platform. You deploy supported language stacks or a custom container; Azure manages much of the underlying infrastructure. The App Service plan defines compute capacity, operating system, and scale boundary for its apps. Scaling a plan can affect every app in that plan, so separate workloads that need independent performance or deployment boundaries.

Deployment slots are live app instances used for staging and controlled swaps. Slot availability depends on the plan tier; some tiers do not support them. A slot swap can move content and configuration, but settings marked slot-specific remain attached to their slot. Validate warm-up, health checks, and swap behavior before relying on zero-downtime claims.

Azure Functions

Functions runs code in response to triggers, such as HTTP requests, timers, storage events, or messages. Bindings simplify connections to selected services but do not eliminate authorization, retries, or data-contract design. Functions can also host HTTP APIs, but event-driven workloads are often the clearest fit.

Hosting plans affect scaling, networking, execution limits, memory, and billing. Current Azure documentation recommends Flex Consumption for many serverless workloads, with features such as virtual network integration, dynamic scale, and per-function scaling; support and behavior vary. Always verify trigger support, region availability, cold-start needs, and plan-specific limits.

Logic Apps

Logic Apps is a managed workflow and integration service with connectors, triggers, and actions. It can reduce custom orchestration code for business processes, SaaS integration, and approvals. It is not a general replacement for application compute; evaluate connector availability, throughput, governance, and consumption pricing.

A practical selection guide

Need OS control or custom system software?       -> Virtual Machines
Need conventional web app and managed runtime?   -> App Service
Need event-triggered code or short tasks?         -> Functions
Need container APIs/workers without cluster ops? -> Container Apps
Need Kubernetes APIs and cluster-level control?  -> AKS
Need connector-led workflow and integration?      -> Logic Apps

These are starting points, not hard boundaries. A service can technically host a workload that is operationally awkward or expensive. Prefer the least complex option that meets runtime, networking, compliance, and scaling needs.

Hands-on: inspect existing apps (read only)

RESOURCE_GROUP="<EXISTING_RESOURCE_GROUP>"
az webapp list --resource-group "$RESOURCE_GROUP" \
  --query "[].{name:name, kind:kind, location:location}" --output table
az functionapp list --resource-group "$RESOURCE_GROUP" \
  --query "[].{name:name, kind:kind, location:location}" --output table

✅ Checkpoint: Identify app kinds and locations. These listings do not show every plan, trigger, slot, or security setting; inspect each resource before making a change.

Security, cost, and production

Use managed identity for Azure service access, store settings in the approved configuration/secret service, and restrict inbound paths. For Functions, make trigger authorization and retry/idempotency behavior explicit. For App Service, review authentication, TLS, deployment credentials, slot-specific settings, and access restrictions.

App Service plan capacity is billed while provisioned, even if an app has little traffic. Functions consumption plans use a different execution-based model with limits and possible always-ready or networking costs. Logic Apps pricing depends on workflow actions and connectors. Include storage, logging, networking, and egress in comparisons; verify current plans and prices.

Troubleshooting

Five-pillar readiness checklist

Cleanup

No Azure resources were created. No cleanup is needed.

Key takeaways

Next: Ship a Containerized API to Azure Container Apps.

Series navigation: Previous: AKS · Current: Phase 4, Part 5 · Next: Container Apps Lab

References

Share this article

LinkedIn post draft