Azure Compute Services Explained: VM, VMSS, AKS, App Service, Functions, and Batch (Part 2)
Azure Cloud Series – Part 2 | By Avadhoot Patil
Your application needs computing power, but which Azure service should run it?
A legacy Windows application, a website, a group of microservices, and a scheduled image-processing job have different requirements. Azure provides several compute services so you can choose an operating model that fits each workload.
In Part 1 of this Azure series, we covered Azure fundamentals. In this guide, we will compare six compute services from a practical DevOps and interview perspective:
- Azure Virtual Machines
- Virtual Machine Scale Sets
- Azure Kubernetes Service
- Azure App Service
- Azure Functions
- Azure Batch
The examples below are illustrative designs. For a production deployment, validate the application’s requirements, service features, costs, and operational responsibilities.
1. Azure Virtual Machines (VM)
An Azure Virtual Machine (VM) is a Windows or Linux server running in Azure. You select its size and operating system, configure networking and disks, install software, and manage the applications running on it.
Practical example
Suppose an older application requires a specific Windows Server configuration and software that cannot easily be moved to a managed web platform. The team could evaluate moving it to an Azure VM.
Moving the application involves more than creating the VM. The team must assess its dependencies, network access, data migration, backups, monitoring, security, and recovery procedure.
What does the team manage?
With a VM, your team is responsible for tasks such as guest operating system updates, installed software, access configuration, application deployment, and monitoring. Azure manages the underlying physical infrastructure.
A DevOps engineer might provision the VM with Terraform or Bicep, configure software with Ansible, and deploy the application through a pipeline.
Interview question: When would you choose a VM instead of App Service?
Choose a VM when the application needs operating system level control, custom software installation, or a configuration that the intended App Service setup cannot support.
2. Virtual Machine Scale Sets (VMSS)
Virtual Machine Scale Sets (VMSS) help you create and manage multiple VM instances as a group. They are useful when an application must run on VMs but needs capacity that can change with demand.
Practical example
An online store runs an application across several VM instances. During a sale, traffic rises. The team configures VMSS and autoscale rules so additional instances can be added when a measured condition is met. When traffic falls, the rules can reduce the instance count.
Autoscaling must be configured; VMSS does not know your application’s desired scaling behavior automatically. A useful rule specifies a metric, threshold, measurement period, scale action, and minimum and maximum instance counts.
For example:
If average CPU utilization stays above 70% for a defined period, add one instance, up to the configured maximum. If it stays below 30% for a longer period, remove one instance, but never go below the configured minimum.
These numbers are an example, not recommended thresholds for every application. Test them against your own traffic and watch for repeated scaling up and down.
Interview question: What is the difference between a VM and VMSS?
A VM is an individual server. VMSS manages a group of VM instances and can scale that group according to configured rules.
Example
You can configure an autoscaling rule such as:
CPU > 70%
↓
Increase VM instances
CPU < 30%
↓
Decrease VM instances
Interview Point
Q: What is the difference between VM and VMSS?
Answer:
A VM represents an individual virtual machine, while VMSS is designed to manage a scalable group of VM instances.
3. Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS) is a managed Kubernetes service for running containerized applications. Azure manages the Kubernetes control plane, while your team still manages important parts of the cluster configuration, worker capacity, application workloads, access, security, and monitoring.
Practical example
Imagine an application with a frontend, a payments API, and an account API. Each application component can be packaged as a container and deployed as a Kubernetes workload on AKS. A database could run separately on an appropriate managed database service.
The team may use Kubernetes Deployments and Services to run and connect the application components. Readiness probes help keep traffic away from pods that are not ready. Liveness probes can restart an unhealthy container. For a slow-starting application, a startup probe can protect it during initialization.
DevOps deployment flow
A possible GitOps workflow is:
- A developer submits a code change.
- CI builds and tests a container image.
- The pipeline pushes the image to Azure Container Registry.
- A reviewed change updates the deployment configuration in Git.
- Argo CD reconciles the approved configuration with AKS.
- The team verifies rollout health, application logs, and metrics.
This is one possible workflow; the exact tools and approval steps depend on the project.
Interview question: Does every containerized application need AKS?
No. Choose AKS when the workload benefits from Kubernetes capabilities and your team can operate the platform and applications. For a straightforward web application, a simpler managed hosting option may be a better fit.
Why AKS?
AKS provides capabilities for:
- Container orchestration
- Microservices
- Auto scaling
- Rolling deployments
- Self-healing
- Service discovery
- Load balancing
- Kubernetes-based DevOps workflows
Example
A typical GitOps deployment could look like:
Developer
↓
GitHub
↓
CI Pipeline
↓
Container Image
↓
Azure Container Registry
↓
Argo CD
↓
AKS
↓
Application Pods
Interview Point
Q: Why use AKS instead of Azure VM?
Answer: AKS is preferable when applications are containerized and require Kubernetes capabilities such as orchestration, scaling, self-healing, rolling deployments, and microservices management.
4. Azure App Service
Azure App Service is a managed platform for hosting web applications and APIs. It lets a team deploy supported applications without administering the underlying servers in the same way it would administer a VM.
Practical example
A team has a .NET website. Instead of provisioning a VM, installing and maintaining its operating system and web server, and deploying the application manually, the team can deploy the application to App Service through Azure DevOps or GitHub Actions.
The team still needs to manage application configuration, identity and access, dependencies, monitoring, and deployment quality.
You don’t need to manage the underlying operating system or physical infrastructure.
Real-World Example
Suppose you have a .NET web application.
Instead of:
Create VM
↓
Install Windows
↓
Install IIS
↓
Configure IIS
↓
Deploy Application
↓
Manage OS
You can use:
Application Code
↓
Azure App Service
↓
Application Running
Azure manages much of the underlying infrastructure.
Common Use Cases
- Web applications
- REST APIs
- Backend applications
- .NET applications
- Node.js applications
- Java applications
- Python applications
DevOps Integration
App Service integrates with CI/CD tools such as:
- Azure DevOps
- GitHub Actions
- Git
- Deployment slots
Deployment Slots
On supported App Service plans, a team can deploy a new version to a staging slot, test it, and then swap it with production. A slot swap is a deployment technique, not a substitute for testing or a rollback plan. Check the configuration and behavior of the application before using slots in production.
Interview question: Why choose App Service instead of a VM?
Choose App Service when your web application is compatible with it and you want to spend less time administering servers. Choose a VM when you need greater operating system control.
Interview Point
Q: Why choose App Service over VM?
Answer: App Service is useful when you want a managed PaaS platform where Azure handles much of the underlying infrastructure and you mainly focus on the application.
5. Azure Functions
Azure Functions is Azure’s serverless compute service.
It allows you to execute code in response to events without managing servers.
Simple Example
Azure Functions runs code in response to triggers. Common examples include HTTP requests, schedules, messages, and storage-related events. You manage the function code and its configuration while the platform handles much of the underlying infrastructure.
Practical example
A user uploads an image. An event starts a function that validates the image, creates a thumbnail, and records the result.
A production design also needs to handle errors. What happens if processing fails? Could the same event be delivered again? Where will failures be logged, and how will the team retry or investigate them? The answer matters as much as the happy-path diagram.
Interview question: Functions versus App Service—which should you use?
Consider App Service for a continuously available website or API. Consider Functions for work naturally triggered by an event or schedule. Compare the workload’s runtime, traffic, latency, and hosting requirements before deciding.
You can create:
File Upload
↓
Azure Blob Storage
↓
Azure Function Trigger
↓
Process File
↓
Store Result
The function runs when the event occurs.
Common Triggers
Azure Functions can be triggered by:
- HTTP requests
- Timer schedules
- Blob Storage events
- Queue messages
- Event Grid
- Service Bus
- Other Azure services
Real-World Example
A company wants to send an email whenever a new customer registers.
Customer Registration
↓
Application
↓
Event
↓
Azure Function
↓
Send Notification
Common Use Cases
- Automation
- Event-driven processing
- Scheduled jobs
- Lightweight APIs
- Background processing
- Integration between Azure services
Interview Point
Q: What is the main difference between VM and Azure Functions?
Answer: A VM provides a complete server environment, while Azure Functions is serverless and allows you to run event-driven code without managing the underlying servers.
6. Azure Batch
Azure Batch helps run large computing jobs across pools of compute resources. It is useful when a job can be split into many tasks that run in parallel.
Practical example
A media company needs to process a million images. Instead of processing them one by one on a single server, it divides the work into smaller tasks and runs them across a Batch pool.
The team still needs to plan how input files reach the tasks, where results are stored, how failed tasks are retried, and when compute resources are scaled down to control cost.
Interview question: When would you choose Batch instead of Functions?
Consider Batch for a large parallel job that needs managed compute pools and task scheduling. Consider Functions for smaller event-driven tasks. Test the workload before making the final choice.
Real-World Example
Imagine a company needs to process:
1 million images
Processing them sequentially would take a long time.
Azure Batch can distribute the work:
1 Million Images
|
↓
Azure Batch
|
┌─────┼─────┬─────┐
↓ ↓ ↓ ↓
VM1 VM2 VM3 VM4
↓ ↓ ↓ ↓
Images processed in parallel
Common Use Cases
- Scientific simulations
- Large-scale data processing
- Rendering
- Financial calculations
- Image/video processing
- High-performance computing
Interview Point
Q: What is Azure Batch mainly used for?
Answer: Azure Batch is mainly used to execute large-scale parallel or HPC workloads by distributing jobs across pools of compute resources.
Quick Comparison
| Service | Good starting point for | What your team operates |
|---|---|---|
| Virtual Machines | Applications needing server and OS control | Guest OS, software, application, access, monitoring |
| VM Scale Sets | Applications needing a scalable group of VMs | VM image and configuration, autoscale rules, application health |
| AKS | Applications needing Kubernetes orchestration | Cluster configuration, worker capacity, workloads, access, security |
| App Service | Supported web applications and APIs | Application, configuration, access, deployment, monitoring |
| Azure Functions | Event-driven or scheduled code | Function code, triggers, configuration, failures, monitoring |
| Azure Batch | Large parallel computing jobs | Jobs, tasks, pool configuration, data flow, cost controls |
🎯 How to Choose the Right Azure Compute Service?
Think about the requirement first:
Need complete OS control?
➡️ Azure Virtual Machine
Need multiple VMs that automatically scale?
➡️ VM Scale Sets
Need Kubernetes and containers?
➡️ AKS
Need to host a web application without managing servers?
➡️ App Service
Need event-driven serverless execution?
➡️ Azure Functions
Need large-scale parallel processing?
➡️ Azure Batch
💡 DevOps perspective: the service choice changes your pipeline
Choosing compute also changes how you deploy and troubleshoot:
- VM: Provision infrastructure, configure the operating system, deploy software, and monitor the server and application.
- VMSS: Manage a repeatable VM configuration and test scaling behavior.
- AKS: Build container images, review Kubernetes configuration, deploy safely, and inspect pods, events, logs, and metrics.
- App Service: Deploy application code, manage configuration, and check application health and deployment results.
- Functions: Deploy code and test triggers, retries, failures, and monitoring.
- Batch: Submit jobs, inspect task results, handle failures, and manage pool capacity.
The best service is one your team can deploy, secure, observe, and recover, as well as one that can run the application.
A typical modern Azure DevOps architecture could look like:
Developer
↓
GitHub / Azure Repos
↓
CI/CD Pipeline
↓
Container Build
↓
Azure Container Registry
↓
AKS
↓
Application
↓
Azure Monitor
🎤 Interview Preparation
Before moving to the next Azure service category, make sure you can explain:
Interview Preparation: Azure Compute
1. What is an Azure Virtual Machine?
An Azure VM is a Windows or Linux server in Azure. I choose it when the application needs operating system or software configuration that I must control.
2. What is the difference between a VM and VMSS?
A VM is an individual server. VMSS manages a group of VM instances and can scale that group when autoscale is configured.
3. What is AKS?
AKS is Azure’s managed Kubernetes service for deploying and operating containerized applications.
4. When would you choose AKS instead of a VM?
I would choose AKS when the application needs Kubernetes orchestration and the team is prepared to operate its workloads. I would choose a VM when I need direct control over the operating system or must run software that is unsuitable for the planned container platform.
5. What is Azure App Service?
App Service is a managed platform for hosting web applications and APIs without administering the underlying servers.
6. When would you choose App Service instead of a VM?
I would choose App Service for a compatible web application when the team wants to focus on deploying and monitoring the application. I would choose a VM if the application requires operating system level control.
7. What is Azure Functions?
Azure Functions runs code in response to triggers such as an HTTP request, a timer, or a message. The team still manages its code, configuration, access, and monitoring.
8. Functions versus App Service: which would you choose?
For a continuously available website or API, I would evaluate App Service. For a small task triggered by an event, such as processing an uploaded file, I would evaluate Functions. The workload and hosting plan determine the final choice.
9. What is Azure Batch used for?
Azure Batch runs large jobs that can be divided into parallel tasks, such as processing many images or running simulations.
10. How do you choose a compute service in a production project?
I start with the application requirements: operating system control, traffic pattern, deployment model, scaling, availability, security, cost, and the team’s operational skills. I select a candidate service, test it with a representative workload, and document why it fits.
🚀 What’s Next?
This is Azure Cloud Series – Part 2: Compute Services.
In the next parts, we will explore other important Azure service categories such as:
🔹 Networking
🔹 Storage
🔹 Databases
🔹 Security & Identity
🔹 Monitoring
🔹 DevOps
🔹 Integration
🔹 Management & Governance
The goal of this series is not just to learn what an Azure service is, but also where it is used, how it works in real-world projects, and how to explain it in interviews.
📌 The detailed PDF below this post for the complete documentation, practical examples, architecture explanations, and interview points.
Follow along for more Azure + DevOps + Kubernetes content. 🚀
Loading Viewer…
Discover more from DevOps with Patil
Subscribe to get the latest posts sent to your email.