Skip to content
6 min read·Lesson 3 of 10

Azure Compute: VMs, App Service, and Functions

Understand Azure's compute services — Virtual Machines, VM Scale Sets, Azure App Service, and Azure Functions — and when to use each.

Azure offers a spectrum of compute options — from full IaaS control with Virtual Machines to fully managed serverless with Azure Functions. Choosing the right service depends on how much infrastructure management you want to own.

Azure Virtual Machines (IaaS)

Azure VMs let you run Windows or Linux in the cloud. You choose the VM size, OS, disk, and network configuration. Azure manages the physical hardware; you manage everything from the OS up.

VM series are grouped by purpose:

SeriesPurposeExamples
B-seriesBurstable / dev/testB2s, B4ms
D-seriesGeneral purposeD4s_v5, D8s_v5
F-seriesCompute optimisedF4s_v2, F16s_v2
E-seriesMemory optimisedE8s_v5
N-seriesGPU (AI / rendering)NC6, ND96amsr_A100
M-seriesUltra memoryM128s (SAP HANA)

VM Scale Sets

VM Scale Sets (VMSS) let you deploy and manage a group of identical, load-balanced VMs. Scale Sets integrate with Azure Monitor to autoscale based on CPU, memory, or custom metrics. Used for:

  • Web front-ends that need to scale with traffic
  • Batch processing workloads
  • High-availability application tiers

Cost Optimisation for VMs

OptionDiscountCommitment
Pay-as-you-goNone
Azure Spot VMsUp to 90%None (preemptible)
Reserved InstancesUp to 72%1 or 3 years
Azure Hybrid BenefitUp to 85%Existing Windows/SQL licences
Dev/Test pricingVariesVisual Studio subscription required

Azure App Service (PaaS)

App Service is a fully managed platform for hosting web applications, RESTful APIs, and mobile backends. Supported languages: .NET, Node.js, Python, Java, PHP, Ruby.

Key features:

  • Built-in auto-scaling and load balancing
  • Integrated CI/CD from GitHub, Azure DevOps, or Bitbucket
  • Custom domains and free managed TLS certificates
  • Deployment slots (staging environments) with swap capability
  • App Service Environments (ASE) for isolated, high-scale deployments in your VNet

Best for: Web applications, APIs, mobile backends — when you want to focus on code rather than infrastructure.

Azure Functions (Serverless)

Azure Functions is Microsoft's Function-as-a-Service (FaaS) offering. Write a function in C#, JavaScript, TypeScript, Python, Java, or PowerShell. Azure handles servers, OS, and scaling.

Trigger types: HTTP, Timer, Blob Storage, Queue Storage, Service Bus, Event Hub, Cosmos DB change feed, and more.

Hosting plans:

  • Consumption plan: Scale to zero, pay per execution and execution time. Cold starts possible.
  • Premium plan: Pre-warmed instances, no cold start, VNet integration.
  • Dedicated (App Service) plan: Run on always-on App Service infrastructure.

Azure Container Apps

Azure Container Apps is a managed serverless container service (similar to GCP Cloud Run). Built on Kubernetes and KEDA (event-driven autoscaling). Best for microservices, APIs, and event-driven workloads without managing Kubernetes clusters.

Key Takeaways

  • Azure Virtual Machines provide IaaS compute — full OS control, ideal for lift-and-shift workloads.
  • VM Scale Sets enable auto-scaling of identical VMs for elastic, high-availability applications.
  • Azure App Service is a PaaS for web apps, APIs, and mobile backends — no VM management required.
  • Azure Functions is the serverless FaaS offering — event-driven, scales to zero, pay-per-execution.
  • Spot VMs and Reserved Instances reduce compute costs significantly.

Test your knowledge

Try exam-style practice questions to reinforce what you've learned.

Practice Questions →