Skip to content
Search lessons, topics, tests…
Esc

    ↑ ↓ moveEnter openEsc close
    Lesson1 / 9

    Module 1 · Compute, Data and Eventing · Lesson 1 of 9

    Compute & Hosting Models

    Start with the failure

    A queue worker runs in Container Apps with minimum replicas set to zero. It only checks the queue from inside its own loop. When all replicas stop, who notices the next message? Identify the missing activation mechanism before calling the design serverless.

    Choose the host from the workload contract

    WorkloadStarting candidateRequirement to verify
    Code-based web API with deployment slotsApp ServicePlan supports slots; shared plan capacity and data-compatible rollback
    Trigger/binding-driven taskFunctionsPlan, trigger support, timeout and downstream concurrency
    Containerized queue worker that sleeps at zeroContainer AppsExternal event scaler, identity/network access and wake-up delay
    Kubernetes operators or custom cluster controlsAKSOperating responsibility and required mode/features
    Short-lived container groupACILifecycle, OS/runtime and orchestration needs

    Interview reference

    Question 1. What is Azure App Service and what does an App Service Plan actually determine?

    App Service is a fully managed PaaS for hosting web apps, REST APIs, and background jobs (WebJobs) without managing servers — it manages host OS patching and load balancing, with scaling features you configure. You still own application dependencies, configuration and custom container image updates. You deploy code or containers and Azure runs them. An App Service Plan is the underlying compute: it defines the region, VM size/SKU (tier), and instance count, and paid dedicated tiers are billed for allocated instances regardless of how many apps run on them. Multiple apps can share one plan (sharing its CPU/memory), so plan sizing is a cost/performance lever. Tiers range from Free/Shared (dev) through Basic, Standard, Premium v3/v4 (production, more memory/features), to Isolated (App Service Environment — dedicated, VNet-injected).

    Question 2. How do deployment slots work, and why are they a safer way to release?

    Deployment slots (available in Standard and above) are live, addressable copies of your app — e.g. a staging slot alongside production. You deploy to staging, warm it up, run smoke tests, then swap: Azure exchanges the slots so staging becomes production with a swap designed to avoid deployment downtime and a swap-back rollback that does not undo database or external state changes. During swap the platform warms the source slot using target settings while the target keeps serving, then switches routing. Settings can be marked slot-specific (sticky) so connection strings or feature flags don't follow the swap. This enables blue-green deployments natively, and you can route a percentage of traffic to a slot for canary testing.

    Example

    Text
    az webapp deployment slot swap \
      --resource-group rg --name myapi \
      --slot staging --target-slot production

    Question 3. How do you scale App Service, and how does autoscale differ from manual scaling?

    Scale up/down changes the plan tier (more CPU/RAM per instance) — vertical. Scale out/in changes the instance count — horizontal, the usual lever for load. Manual scaling fixes the count; autoscale (Standard+) adjusts it against metric rules (CPU %, memory, HTTP queue length) or a schedule, within min/max bounds.

    Configure autoscale to scale out aggressively, in conservatively (with cooldowns) to avoid flapping, and always set a sensible max to cap cost. Design the application to tolerate instance replacement and load balancing: use an external store for shared durable/session state rather than relying on one process's memory. Setting a maximum bounds this scale-out dimension, not the entire Azure bill. App Service also has a separate HTTP-traffic-driven automatic scaling feature on Premium v2–v4; it is not Azure Monitor's metric/schedule autoscale. Only one scaling method should be active for a plan. Scaling options.

    Question 4. Give a decision framework for choosing among App Service, Functions, Container Apps, AKS, and ACI.

    Match the workload's shape to the platform. App Service for traditional always-on web apps/APIs you deploy as code. Azure Functions for event-driven, bursty, serverless work with rich triggers/bindings. Container Apps for containerized microservices and event-driven workers wanting managed scaling without operating Kubernetes. Scale-to-zero depends on the configured minimum and supported trigger; a worker without ingress needs a suitable scale rule to wake from zero. AKS when you need full Kubernetes control (operators, custom networking, service mesh). ACI for simple, short-lived or burst container workloads; Linux container groups can contain multiple cooperating containers with a shared lifecycle. Axes that decide it: code vs container, always-on vs scale-to-zero, event-driven vs request/response, and how much infrastructure control you want. App Service (web), Functions (events) and Container Apps (containerized services) are useful starting candidates, not a claim about which platform most projects use.

    Example

    Text
    Traditional web app / API (code) ...... App Service
    Event-driven, bursty, triggers ........ Functions
    Containerized microservices/workers ... Container Apps
    Full Kubernetes control needed ........ AKS
    One-off / burst single container ...... ACI

    Question 5. What is Azure Container Registry (ACR) and how does it fit a .NET container pipeline?

    ACR is a managed private Docker/OCI registry for storing and distributing your container images and Helm charts, close to your Azure compute. CI builds an image and pushes it to ACR; App Service, Container Apps, or AKS pull from it using a managed identity (no registry passwords). It supports geo-replication (Premium), Defender integration for vulnerability assessment, and ACR Tasks for cloud builds. Docker Content Trust is deprecated and scheduled for removal on March 31, 2028; use the Notary Project/Notation signing and verification approach for new designs. Signatures must be verified by your deployment workflow or enforcement tooling; storing a signed image alone does not enforce trust. ACR signing transition. Use AcrPull + managed identity for RBAC-only registries, or Container Registry Repository Reader for ABAC-enabled registries. Use unique build-SHA tags and lock deployed tags, or pin image digests. Cleanup must preserve deployed and rollback artifacts: ACR's untagged-manifest retention policy is not a generic age policy for all images, and deleting an untagged manifest can break a digest-pinned deployment. Check current tier/media-type support and exclusions before enabling it. Retention policy.

    Example

    Text
    az acr build -r myregistry -t api:$(git rev-parse --short HEAD) .
    
    # Container App pulls via managed identity from an RBAC-only registry:
    az role assignment create --assignee <app-mi> \
      --role AcrPull --scope <acr-resource-id>

    Question 6. When would you still reach for Virtual Machines or Scale Sets instead of PaaS?

    Choose IaaS (VMs / Virtual Machine Scale Sets) when you need full control of the OS and runtime, must run software PaaS can't host (legacy services, specific drivers, custom networking/ports), require lift-and-shift of an existing server, or have licensing/compliance constraints that demand OS-level access. VMSS supports autoscaling and integration with a separately configured load balancer. Uniform orchestration uses a common VM profile; Flexible orchestration can manage identical or mixed VM types. It is not restricted to an identical fleet in every mode. Orchestration modes. The trade-off is operational responsibility: you own patching, hardening, and availability. Prefer PaaS/containers unless a concrete requirement forces IaaS — it's the most control but the most work.

    Question 7. What is WebJobs and how does it relate to Azure Functions?

    WebJobs is the background-processing feature of App Service — it runs scripts or programs (continuous or triggered) in the context of a Web App, sharing its plan. Azure Functions builds on the WebJobs ecosystem with a managed host and rich triggers/bindings. Its scaling and billing depend on the hosting option; a Functions app on a Dedicated App Service plan does not gain automatic event-driven scale-to-zero merely by being a Functions app. Use WebJobs when you already run an App Service web app and want a simple co-located background task on the same plan. Choose Functions with an appropriate hosting option when you need managed event-driven scaling or its programming model. Consumption-style options can scale to zero; Premium/Dedicated have different minimum-capacity and billing behavior. For reliable continuous or scheduled WebJobs, check Always On and plan requirements; WebJobs share app resources rather than gaining an independent compute budget. Functions hosting, WebJobs.

    Check your decision

    A zero-replica Container Apps worker has no ingress or event-based scale rule. Its code polls a queue. What wakes it when work arrives?

    A The polling loop, because the image is stored in ACR
    B Nothing in that design; configure a supported external scale signal or retain running capacity
    C An HTTP scaling rule with no incoming HTTP traffic must detect the queue backlog
    D Setting a maximum replica count automatically polls every queue
    Show answer

    Correct answer: B

    Code cannot poll while no replica exists. A supported external scaler must observe the backlog and activate the worker, with its own identity/network configuration; alternatively keep a suitable minimum. A registry and replica ceiling are not activation signals.

    Hint: Ask which component is still running when the worker is not.

    Practice before reading the answers

    1. Two busy apps share one paid dedicated App Service plan. Does deploying a third app create an independent CPU/memory budget?
    1. A slot swap is reversed after the new release changed the database schema. What compatibility question must be answered before routing back?

    Answer check

    1. No. The apps share the plan’s allocated compute. Measure contention, scale the plan or isolate workloads when their requirements differ.
    1. Can the old code safely read/write the current schema and data? A routing rollback does not undo migrations, sent messages or external effects; use compatible rollout steps and a recovery plan.
    Sign in to mark lessons done and keep your place in the course.Sign in

    TechInterviewNotes Editorial Team · Updated 28 Oct 2026 ·