AZ-305 - Design a Compute Strategy
Azure Compute Options Overview
Azure provides a range of compute services, each suited to different workload types. Choosing the right compute option requires understanding application architecture, scaling requirements, management overhead tolerance, and cost considerations.
Compute Services Comparison
| Service | Type | Best For | Management Level |
|---|---|---|---|
| Azure Virtual Machines | IaaS | Full OS control, legacy apps, custom software | High (you manage OS, patches, runtime) |
| Azure App Service | PaaS | Web apps, REST APIs, mobile backends | Low (managed platform, you deploy code) |
| Azure Functions | Serverless | Event-driven, short-running tasks, microservices | Minimal (pay-per-execution, auto-scales) |
| Azure Container Instances (ACI) | CaaS | Simple container workloads, burst scenarios | Low (no cluster management) |
| Azure Kubernetes Service (AKS) | CaaS | Complex microservices, container orchestration | Medium (managed control plane, you manage nodes) |
| Azure Service Fabric | PaaS/CaaS | Stateful microservices, high-scale distributed systems | Medium to High |
Azure Virtual Machines
When to Use VMs
Choose Azure VMs when you need full control over the operating system, need to run custom software or legacy applications that cannot be containerized, require specific OS configurations, or need to run software that does not support PaaS platforms. VMs offer the most flexibility but require the most management effort including patching, monitoring, and backup.
Azure App Service
When to Use App Service
Azure App Service is a fully managed platform for hosting web applications, REST APIs, and mobile backends. It supports .NET, Java, Node.js, Python, and PHP. Key features include built-in auto-scaling, deployment slots for zero-downtime deployments, custom domain and SSL support, and integration with Azure DevOps and GitHub Actions. App Service is the best choice when you want to focus on code without managing infrastructure.
Azure Functions
Azure Functions is a serverless compute service that runs code in response to events such as HTTP requests, timer schedules, queue messages, or blob storage changes. Functions support three hosting plans:
- Consumption Plan: Automatic scaling, pay only when functions run, cold start possible.
- Premium Plan: Pre-warmed instances (no cold start), VNet connectivity, unlimited execution duration.
- Dedicated (App Service) Plan: Runs on existing App Service infrastructure, always running, predictable billing.
Container Options (ACI vs AKS)
ACI vs AKS Decision
Azure Container Instances (ACI): Best for simple, isolated container workloads that do not require orchestration. Fast startup (seconds), per-second billing, and no cluster to manage. Ideal for build jobs, task automation, and burst workloads. ACI can integrate with AKS via the virtual kubelet for burstable scenarios.
Azure Kubernetes Service (AKS): Best for complex, multi-container applications requiring service discovery, load balancing, rolling updates, secrets management, and horizontal pod autoscaling. AKS provides a managed Kubernetes control plane at no charge; you only pay for worker nodes.
Choosing the Right Compute Service
The AZ-305 exam expects you to apply a decision tree when selecting compute services. The key factors in the decision are:
Decision Criteria
Compute Decision Tree
1. Do you need full OS control? If yes, use Azure VMs.
2. Is the workload containerized? If a simple container, use ACI. If complex orchestration is needed, use AKS.
3. Is it a web application or API? Use App Service for standard web apps. Use App Service Environment (ASE) for network isolation.
4. Is it event-driven with short execution? Use Azure Functions on the Consumption plan. For long-running event-driven tasks, use the Premium or Dedicated plan.
5. Do you need stateful microservices? Consider Azure Service Fabric or AKS with stateful sets.
High-Performance Computing (HPC)
Azure Batch is the managed HPC service for running large-scale parallel and batch compute workloads. It is commonly tested in exam scenarios involving rendering, simulation, genomics, and financial modeling.
Azure Batch
Azure Batch Overview
Azure Batch provisions and manages a pool of compute VMs, installs applications and data, schedules jobs across the pool, monitors execution, and handles retries for failed tasks. You define the pool size (fixed or autoscale), VM series, and task parallelism. Batch supports both Linux and Windows worker nodes and can use low-priority (Spot) VMs for significant cost savings on interruptible workloads.
HPC VM Series
For HPC workloads, Azure offers specialized VM series: H-series for general HPC, HB-series for memory-bandwidth-sensitive workloads, HC-series for compute-intensive workloads, and N-series VMs with NVIDIA GPUs for GPU-accelerated rendering and deep learning.
Azure Virtual Desktop
Azure Virtual Desktop (AVD) is a desktop and application virtualization service that runs in the cloud. It provides a full Windows desktop experience on Azure infrastructure.
Key Capabilities
AVD Features
AVD supports Windows 10/11 Enterprise multi-session, allowing multiple concurrent users on a single VM to maximize resource utilization. It integrates with Microsoft 365 Apps for Enterprise and supports FSLogix profile containers for fast user profile loading. Host pools can be personal (one-to-one) or pooled (shared across users). Autoscaling adjusts the number of session hosts based on demand.
Spot VMs and Cost Optimization
Azure Spot VMs
Azure Spot VMs use surplus Azure capacity at significantly reduced prices (up to 90 percent discount). However, Azure can evict Spot VMs at any time when it needs the capacity back. Spot VMs are ideal for workloads that can tolerate interruptions such as batch processing, dev/test environments, CI/CD build agents, and big data analytics.
VM Sizes and Series
| Series | Optimized For | Use Cases |
|---|---|---|
| B-series | Burstable | Dev/test, small databases, low-traffic web servers |
| D-series | General purpose | Enterprise apps, mid-tier databases, gaming servers |
| E-series | Memory | Large databases, in-memory analytics, SAP |
| F-series | Compute | Batch processing, gaming, analytics, CI/CD |
| N-series | GPU | AI/ML, rendering, simulation, video encoding |
| L-series | Storage | Big data, NoSQL databases, data warehousing |
Auto-Scaling Strategies
Scaling Approaches
Virtual Machine Scale Sets (VMSS): Automatically create and manage a group of identical VMs. Supports autoscale rules based on CPU, memory, or custom metrics. Integrates with Azure Load Balancer and Application Gateway.
App Service Autoscale: Scale out (add instances) or scale up (increase resources) based on rules or schedules. Supports metric-based rules and time-based schedules.
AKS Autoscaling: Horizontal Pod Autoscaler (HPA) scales pods, and Cluster Autoscaler adds or removes nodes. KEDA (Kubernetes Event-Driven Autoscaling) scales based on external event sources.
Functions Consumption Plan: Scales automatically from zero to hundreds of instances based on event volume. No manual configuration required.
Key Terms
| Term | Definition |
|---|---|
| Azure App Service | A fully managed PaaS for hosting web apps, APIs, and mobile backends with built-in scaling and deployment features. |
| Azure Functions | A serverless compute service that executes code in response to events without requiring infrastructure management. |
| AKS (Azure Kubernetes Service) | A managed container orchestration service based on Kubernetes, with a free managed control plane. |
| Azure Batch | A managed service for running large-scale parallel and HPC workloads across pools of compute nodes. |
| Azure Virtual Desktop (AVD) | A cloud-based desktop and app virtualization service supporting multi-session Windows and FSLogix profiles. |
| Spot VM | A VM that uses surplus Azure capacity at a deep discount, but can be evicted when Azure needs the capacity back. |
| VMSS (Virtual Machine Scale Sets) | A service that deploys and manages a set of identical, auto-scaling VMs behind a load balancer. |
| Cold Start | The initial delay experienced when a serverless function instance is being provisioned for the first time or after idle timeout. |
Exam Tips
- App Service is the default for web apps - unless the scenario requires full OS control or containers, App Service is typically the correct choice for web applications and APIs.
- Functions Consumption Plan scales to zero - when the exam mentions cost optimization for sporadic workloads, Consumption Plan Functions that scale from zero is the answer.
- AKS for complex microservices, ACI for simple containers - if the scenario involves orchestration, service mesh, or rolling deployments, choose AKS. For quick, isolated tasks, choose ACI.
- Azure Batch for HPC and parallel workloads - any question about rendering, simulation, or large-scale batch processing should point to Azure Batch.
- Spot VMs can be evicted - only recommend Spot VMs when the workload can handle interruptions. Never use Spot VMs for production applications requiring continuous availability.
- AVD multi-session reduces costs - Windows 10/11 Enterprise multi-session on AVD allows multiple users per VM, which is a key cost optimization for virtual desktop scenarios.
Practice Questions
Question 1
Your company needs to host a web application that supports automatic scaling and zero-downtime deployments using deployment slots. You want to minimize management overhead. Which compute service should you use?
- A. Azure Virtual Machines
- B. Azure App Service
- C. Azure Container Instances
- D. Azure Functions
Answer: B
Explanation: Azure App Service is a fully managed PaaS that provides built-in auto-scaling and deployment slots for zero-downtime deployments. It minimizes management overhead compared to VMs while offering enterprise-grade hosting for web applications.
Question 2
A financial services company needs to run large-scale Monte Carlo simulations across thousands of compute nodes. Which Azure service is best suited for this workload?
- A. Azure App Service
- B. Azure Functions
- C. Azure Batch
- D. Azure Container Instances
Answer: C
Explanation: Azure Batch is designed for large-scale parallel and HPC workloads. It can provision thousands of compute nodes, schedule jobs, manage task execution, and automatically scale pools based on workload demand. Monte Carlo simulations are a classic HPC use case.
Question 3
You are designing a solution for a microservices application with 15 services that require service discovery, rolling updates, and horizontal pod autoscaling. Which service should you recommend?
- A. Azure Virtual Machines with a load balancer
- B. Azure Container Instances
- C. Azure Kubernetes Service (AKS)
- D. Azure App Service
Answer: C
Explanation: AKS provides managed Kubernetes with built-in service discovery, rolling updates, horizontal pod autoscaling, and the ability to orchestrate complex multi-container applications. ACI lacks orchestration capabilities, and VMs would require significant manual management for 15 services.
Question 4
A development team needs to run nightly CI/CD build jobs at the lowest possible cost. The jobs can tolerate interruptions. Which compute option should you recommend?
- A. Azure VMs with Reserved Instances
- B. Azure Spot VMs
- C. Azure App Service Premium plan
- D. Azure Functions Premium plan
Answer: B
Explanation: Azure Spot VMs provide up to 90 percent discount on regular VM pricing by using surplus capacity. Since CI/CD build jobs can tolerate interruptions and restarts, Spot VMs provide the lowest cost option for this scenario.
Question 5
An organization needs to provide virtual desktops to 500 users while minimizing infrastructure costs. Users run standard Office applications. What should you recommend?
- A. Azure VMs with one VM per user
- B. Azure Virtual Desktop with pooled host pools and multi-session
- C. Azure Container Instances for each user session
- D. Azure App Service with remote desktop enabled
Answer: B
Explanation: Azure Virtual Desktop with Windows 10/11 Enterprise multi-session allows multiple users to share a single VM, significantly reducing the number of VMs needed. Pooled host pools allocate sessions dynamically across available hosts, further optimizing costs for standard productivity workloads.
AZ-305 Designing Azure Infrastructure Solutions - Table of Contents
Master all exam topics with comprehensive study guides and practice questions.