CodeMIRAI
0 XP

Containers, App Service and Functions

2 min read Quiz included

Virtual machines are not the only way to run code in Azure. Containers, serverless functions and App Service are often simpler and cheaper.

Containers

A container packages an application with everything it needs (libraries, settings) into a lightweight unit. Unlike a VM, a container shares the host's operating system kernel, so it starts in seconds and uses far fewer resources. Docker is the best-known container format.

Azure's container services:

ServiceWhat it isUse it when
Azure Container Instances (ACI)the fastest, simplest way to run a container; PaaS, no VMs to manageyou want to run a single container or a short job
Azure Container Appsserverless containers with built-in load balancing and scalingyou want to run microservices without managing a cluster
Azure Kubernetes Service (AKS)managed Kubernetes for orchestrating many containersyou run large, complex applications made of many containers

Azure Functions

Azure Functions is serverless compute that runs your code in response to an event: an HTTP request, a message in a queue, a file in storage, or a timer.

  • No servers to manage; it scales automatically.
  • On the consumption plan you pay only while your code runs.
  • Functions can be stateless (the default) or stateful with Durable Functions.

Use Functions for short pieces of work triggered by events, such as resizing an image when it is uploaded.

Azure App Service

Azure App Service is a fully managed PaaS for hosting web apps, REST APIs and mobile back ends. You deploy your code (in .NET, Java, Node.js, Python, PHP and more) and Azure handles the servers, the operating system, patching, load balancing and scaling. It runs on Windows or Linux, and deploys straight from GitHub or Azure DevOps.

App Service hosts four kinds of app:

  • Web apps: websites and web applications.
  • API apps: REST APIs, with support for Swagger/OpenAPI.
  • WebJobs: background programs or scripts that run alongside a web app.
  • Mobile apps: back ends for iOS and Android apps, with data storage, sign-in and push notifications.

Choosing where to host an application

NeedChoose
Full control of the OS, legacy software Virtual machines
A website or API without managing servers App Service
Code that runs briefly when something happens Functions
A packaged, portable application Containers (ACI, Container Apps, AKS)
Finished this lesson?Mark it complete to earn +20 XP and move your progress on.