Design infrastructure solutions · Topic 1 of 10

Virtual Machine and Container Compute Solutions

AZ-305 compute design: choose VM sizes, scale sets, Spot and reservations, and decide between App Service, Container Apps, AKS and Container Instances.

  • 5 min
In a nutshell
  • VM families: B burstable, D general, E memory, F compute, L storage, N GPU, H HPC. Use Premium SSD for production.
  • Reservations and savings plans cut steady costs, Spot suits interruptible work, and Hybrid Benefit reuses licenses.
  • Container Apps is the default container choice. AKS is for Kubernetes API control. ACI is for single short lived containers.

What it is

Azure offers a spectrum of compute, from virtual machines (most control, most management) to containers and platform services (less control, less management). The architect specifies the components of a solution from the workload's needs: CPU, memory, storage, GPU, OS, scaling, state and how much operational effort the team will accept. Then chooses between VM based and container based designs.

Workload needsOS, scale, state, effortMore controlvirtual machinesContainersContainer Apps, AKSLess to manageApp Service, serverless

How it works

Specifying VM components

ComponentChoice
Size familyB burstable (low average CPU), D general purpose, E memory optimised, F compute optimised, L storage optimised, M very large memory, N GPU, H HPC
DisksPremium SSD for production, Premium SSD v2 for tunable IOPS, Ultra for the highest performance, Standard for dev and test and backups. Choose zone redundant (ZRS) disks for resilience
AvailabilityAvailability zones or sets, or a scale set
ImageMarketplace, custom image, Azure Compute Gallery for sharing and versions
SecurityTrusted Launch, confidential VMs for data in use, Azure Disk Encryption or server side encryption with customer managed keys, Bastion instead of public RDP
PlacementProximity placement groups for low latency, dedicated hosts for licensing or isolation

Pricing and cost options

OptionUse
Pay as you goUnpredictable, short term
Reservations (1 or 3 years) and savings plansSteady, predictable workloads, large discounts
Spot VMsInterruptible work such as batch and dev and test, at a deep discount, with possible eviction
Azure Hybrid BenefitReuse Windows Server and SQL Server licenses
Autoscale and auto shutdownAvoid paying for idle capacity

Scale sets

Virtual Machine Scale Sets scale out and in automatically. Use Flexible orchestration for new designs. Pair with a load balancer and autoscale rules on metrics or schedules. Use instance mix to combine sizes or Spot and regular instances.

When to use VMs

Choose VMs when you need OS level access, legacy or lift and shift workloads, unsupported software, specialised drivers or GPUs, or licensing control. Accept that you own patching, scaling and availability. Use Azure Update Manager for patching and Azure Arc for hybrid.

Container based solutions

ServiceFits
Azure Container AppsThe default for most containerised apps and microservices. Built on Kubernetes but hides the cluster. Scale to zero, KEDA event scaling, Dapr, revisions and traffic splitting. No access to the Kubernetes API
Azure Kubernetes Service (AKS)You need Kubernetes API access, custom controllers, a service mesh, node level control, GPUs or specific scheduling. Most configurable and most to operate
Azure Container Instances (ACI)A single container or small group for short lived or burst jobs. No orchestration, no autoscale
App Service for ContainersA web app packaged as a container. HTTP and HTTPS only
Azure Container Registry (ACR)Stores images, with geo replication, vulnerability scanning and private access
Azure Red Hat OpenShiftManaged OpenShift for existing OpenShift skills

Compared with each other: App Service is the simplest for web apps and APIs. Container Apps adds microservice and event driven features. AKS gives complete control. Use managed identities for pulls from ACR, private clusters for restricted APIs, and node pools across zones for availability. A third party container that cannot be modified can use sidecar and ambassador containers in the same Container App to add logging and proxy behaviour.

Choosing quickly

RequirementAnswer
Lift and shift a legacy app that needs the OSVirtual machines in a scale set or availability zones
Microservices without managing Kubernetes, scale to zeroAzure Container Apps
A custom operator and service meshAKS
One short lived container jobAzure Container Instances (or a Container Apps job)
Interruptible batch compute at lowest priceSpot VMs
Predictable VMs for 3 yearsReserved instances or a savings plan
A simple web API with minimal managementApp Service

A worked scenario

A team has a legacy Windows service, a new set of five microservices, and an overnight image processing job. The architect keeps the legacy service on VMs in an availability zone scale set with reserved instances, puts the microservices on Container Apps with scale to zero and Dapr, and runs the overnight job on Spot VMs in a scale set that tolerates eviction. A private ACR with managed identity pulls images.

What to remember for the exam

  • VM families: B burstable, D general, E memory, F compute, L storage, N GPU, H HPC. Use Premium SSD for production.
  • Reservations and savings plans cut steady costs, Spot suits interruptible work, and Hybrid Benefit reuses licenses.
  • Container Apps is the default container choice. AKS is for Kubernetes API control. ACI is for single short lived containers.
  • App Service Web App for Containers supports only HTTP and HTTPS.
  • Sidecar and ambassador containers can extend a container you cannot modify.
Exam tip

"No cluster management" and "scale to zero" mean Container Apps. "Kubernetes API access" means AKS.

How the exam asks about this

  • "Run microservices with event driven scaling and no cluster management." Azure Container Apps.
  • "Custom Kubernetes controllers and a service mesh." AKS.
  • "Run interruptible batch jobs as cheaply as possible." Spot VMs.
  • "Reduce cost of a steady workload for three years." Reserved instances or a savings plan.

Common mistakes

Choosing AKS by default. Container Apps is simpler.

Using Spot for databases or stateful services.

ACI for production microservices. It lacks orchestration.

Public RDP instead of Bastion.

Check yourself

  • Which container service hides the Kubernetes cluster and scales to zero?

    Azure Container Apps.

  • Which VM option gives deep discounts but can be evicted?

    Spot VMs.

  • Which service gives access to the Kubernetes API?

    Azure Kubernetes Service.

Topic 1 of 10 in Design infrastructure solutions

Test yourself on Design infrastructure solutions

The full Microsoft AZ-305 question bank has 755 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.