Lesson 5 of 5 Azure Compute Services

Comparing Application Hosting Options in Azure

This lesson explains Azure App Service, the Azure container services and virtual machines as options for hosting applications, and how to choose between them.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe Azure App Service and the kinds of app it hosts.
  • Distinguish Azure Container Instances, Azure Container Apps and Azure Kubernetes Service.
  • Identify the appropriate hosting option for an application.

Azure App Service

Azure App Service is an HTTP-based PaaS service for hosting web applications, REST APIs and mobile back ends. It supports .NET, Java, Node.js, Python and PHP on Windows or Linux, and can also run custom containers. Microsoft manages the underlying VMs and operating systems, and App Service adds enterprise features: automatic scaling, built-in load balancing, high availability, continuous deployment from GitHub or Azure DevOps, deployment slots for testing a release before swapping it into production, custom domains with certificates, and built-in authentication.

App Service hosts several kinds of app: web apps, API apps, WebJobs for background tasks, and back ends for mobile apps. An App Service plan defines the compute resources and pricing tier that the apps run on. For a typical web application with no special operating system requirements, App Service is the hosting option with the least management.

True or false

App Service features

Exam skills 2.2.4

Check what Azure App Service provides.

Log in to try this activity Interactive activities are free with an account.

Container hosting options

Azure offers several services for running containers, which differ in how much orchestration and control they provide. The following table compares them.

ServiceWhat it isBest for
Azure Container Instances (ACI)Runs individual containers on demand as a PaaS service, with no servers or orchestrator to manageSimple apps, batch jobs and tasks that need a container quickly
Azure Container AppsA serverless platform for containerized apps with built-in load balancing, scaling (including to zero) and HTTPSMicroservices and web APIs without managing Kubernetes
Azure Kubernetes Service (AKS)A managed Kubernetes service; Azure manages the control plane, and you manage the worker nodes and workloadsOrchestrating many containers with full Kubernetes control

Container images are usually stored in Azure Container Registry, a private registry from which these services pull images. App Service can also run containers, which suits a containerized web application that benefits from App Service features.

Scenario questions

Which container service?

Exam skills 2.2.4

Choose the container service that fits each need.

Log in to try this activity Interactive activities are free with an account.

Virtual machines as a hosting option

Virtual machines can host any application, because the customer controls the whole operating system. They are the right choice when the application needs a specific operating system configuration, software that the PaaS options do not support, or a lift-and-shift move with no changes. The cost is that the customer must patch, scale and maintain the servers. A useful order of preference for a new web application is App Service first, containers when the application is containerized or built from microservices, and VMs when neither fits.

Choosing a hosting option

The choice trades management effort for control. The following comparison summarizes the three approaches.

App Service
Service typePaaS
Customer managesCode and configuration
ScalingBuilt-in autoscale
Choose when A standard web app or API
Containers
Service typePaaS (ACI, Container Apps) or managed orchestration (AKS)
Customer managesContainer images and configuration
ScalingBuilt-in (Container Apps, AKS)
Choose when Containerized apps or microservices
Virtual machines
Service typeIaaS
Customer managesOS, runtime and application
ScalingScale sets or manual
Choose when Full OS control is required
Sort into groups

Where should it run?

Exam skills 2.2.4

Choose a hosting option for each application.

Log in to try this activity Interactive activities are free with an account.
Worked example

Choosing a host

A team has packaged a nightly data-cleansing job as a container image. The job runs for about 20 minutes each night and must not incur charges for the rest of the day. The team does not want to manage servers or a Kubernetes cluster. Which Azure service should run the job?

Azure Container Instances runs a container on demand and bills only while the container runs, with no servers or orchestrator to manage, which fits a short nightly job. Azure Container Apps jobs could also run it, but AKS would require managing a cluster whose nodes cost money all day, and a VM would also incur charges while idle unless stopped and started. App Service is designed for continuously running web apps rather than short batch jobs.

Check yourself

Which container service gives full Kubernetes orchestration with a Microsoft-managed control plane?

Show answer

Azure Kubernetes Service (AKS).

Exam Tips

Remember for the exam

  • Web apps and APIs with the least management: Azure App Service (PaaS).
  • Run a container quickly with no orchestration: Azure Container Instances.
  • Serverless microservices in containers: Azure Container Apps. Full Kubernetes orchestration: AKS.
  • Use VMs when the app needs full OS control.