Challenge 10: Containers & App Hosting
20-30 min | Cost: Free | Domain: Azure Architecture & Services (35-40%)
Exam skills covered
- Compare compute types (containers, VMs, functions)
- Describe application hosting options (web apps, containers, VMs)
- Describe Azure Functions
Overview
Beyond VMs, Azure offers lighter-weight compute options. Containers package your application with its dependencies into a portable unit. Azure App Service hosts web apps without managing VMs. Azure Functions run individual pieces of code on-demand (serverless).
Each option trades control for simplicity: VMs give maximum control, containers provide portability, App Service simplifies web hosting, and Functions are the simplest — just write code.
Explore
Task 1: Compare compute options
| Service | What you manage | Scale unit | Start-up time | Best for |
|---|---|---|---|---|
| Azure VMs | OS + Apps | Full VM | Minutes | Legacy apps, full control |
| Azure Container Instances | Container image | Container | Seconds | Simple container tasks |
| Azure Container Apps | Container image + scaling rules | Container | Seconds | Microservices |
| Azure App Service | Application code | App instance | Seconds | Web apps and APIs |
| Azure Functions | Function code | Single function | Milliseconds | Event-driven tasks |
Task 2: Explore Azure App Service
- In Azure Portal, search for App Services
- Click + Create → Web App
- Explore the creation form:
- Runtime stack: .NET, Java, Node.js, Python, PHP, Ruby
- Operating System: Linux or Windows
- App Service Plan: Pricing tier (Free F1 available!)
- Notice: no VM size, no OS patches, no networking config
- Click Cancel
Free tier (F1):
- 60 CPU minutes/day
- 1 GB RAM
- No custom domain (uses azurewebsites.net)
- Perfect for learning!
Task 3: Explore Azure Functions
- In Azure Portal, search for Function App
- Click + Create
- Explore:
- Runtime: .NET, Java, Node.js, Python, PowerShell
- Hosting plan: Consumption (pay per execution), Premium, or Dedicated
- Consumption plan = true serverless:
- First 1 million executions/month = FREE
- Auto-scales from 0 to thousands of instances
- Click Cancel
Function triggers (what causes the code to run):
| Trigger | Example |
|---|---|
| HTTP | REST API endpoint |
| Timer | Run every 5 minutes |
| Blob Storage | File uploaded |
| Queue | Message received |
| Event Grid | Event occurred |
Task 4: Understand containers
Containers are lightweight, portable packages that include:
- Your application code
- Runtime and libraries
- Configuration files
- Everything needed to run — regardless of the host
| Concept | VM | Container |
|---|---|---|
| Includes | Full OS + Apps | App + dependencies only |
| Size | Gigabytes | Megabytes |
| Start time | Minutes | Seconds |
| Isolation | Hardware-level | Process-level |
| Density | Few per host | Hundreds per host |
Azure container services:
- Azure Container Instances (ACI): Run a container without managing VMs
- Azure Container Apps: Managed microservices platform
- Azure Kubernetes Service (AKS): Full container orchestration
Task 5: When to use what
| Scenario | Best choice | Why |
|---|---|---|
| Host a WordPress blog | App Service | PaaS web hosting, easy setup |
| Process images when uploaded | Azure Functions | Event-driven, pay per execution |
| Run a containerized microservice | Container Apps | Managed container hosting |
| Migrate an on-prem server | Azure VM | Lift-and-shift, full control |
| Run a batch job for 10 minutes | ACI | Simple container, no long-running cost |
# List available App Service runtimes
az webapp list-runtimes --output table
# List available Function App runtimes
az functionapp list-runtimes --os linux --output table
Key Concepts
| Concept | Description |
|---|---|
| Azure App Service | PaaS for web apps, APIs, mobile backends |
| Azure Functions | Serverless compute — run code on-demand, pay per execution |
| Container | Lightweight package with app + dependencies (portable) |
| ACI | Run a container without managing infrastructure |
| Container Apps | Managed platform for microservice containers |
| AKS | Managed Kubernetes for complex container orchestration |
| Serverless | No server management, automatic scaling, per-execution billing |
Knowledge Check
1. Which Azure service allows you to run code that responds to events without managing any infrastructure?
2. What is a key advantage of containers compared to virtual machines?
3. A developer wants to host a web application with automatic scaling and no server management. The app is written in Python. Which service is most appropriate?
4. On the Azure Functions Consumption plan, when do you pay?
5. Which Azure service provides managed Kubernetes container orchestration?