4: Design infrastructure solutions

    Recommend a virtual machine-based compute solution

    Picking a VM-based compute path is the right answer when a workload depends on something the platform-as-a-service layer cannot expose: a kernel driver, a Windows Server role that needs schema rights on the operating system, a third-party hypervisor agent that needs admin on the box, a Group Policy boundary that cannot be replaced with Microsoft Intune, a specialised GPU SKU, or a custom image baked over decades of operational hardening. The architect's job is to match the workload to the right family, place the disks correctly, choose the scale-set orchestration mode that fits the application topology, and connect the result to the on-premises networks that still source identity, certificates, file shares, or licensing.

    The first decision is the VM family. The general-purpose D-series is the default for line-of-business workloads with balanced CPU-to-memory ratio. The E-series doubles memory per vCPU and is the right answer for in-memory caches, SAP HANA scale-up nodes, and database tier hosts that are not yet on Azure SQL Managed Instance. The F-series doubles CPU per memory unit and fits batch compute and web-tier workloads with low memory footprint. The M-series carries multi-terabyte memory for the largest SAP HANA and SQL Server deployments. The L-series exposes locally attached NVMe for storage workloads that cannot tolerate the latency of Premium SSD over the network. The N-series carries NVIDIA GPUs and is gated by quota and regional availability; an architect must check the SKU and the region before promising the design. The B-series is burstable and the correct answer only for dev/test or workloads with idle baselines; it is the wrong answer for production database tiers because credits exhaust under sustained load.

    The disk decision is independent of the VM family and is the second design knob. Standard HDD is for archival and dev/test. Standard SSD lifts random IO at modest cost but is bounded by per-disk IOPS. Premium SSD v2 is the right answer for most production workloads because it decouples capacity from IOPS and throughput, letting the architect dial 80,000 IOPS or 1,200 MB/s without growing the disk size. Ultra Disk is the answer for workloads with sub-millisecond latency requirements and IOPS that exceed Premium SSD v2 ceilings, with the caveat that Ultra Disk is gated to specific VM families and zones. Local temporary disks are ephemeral and lose data on deallocation; placing a page file or a tempdb on the local disk is correct, placing application state there is an anti-pattern.

    For multi-instance workloads the orchestration choice is between Virtual Machine Scale Sets in Flexible orchestration mode and Uniform mode. Flexible is the recommendation for new designs because it supports a mix of VM sizes within the same scale set, integrates with availability zones natively, and exposes individual VM instances as first-class Azure resources that other services can target. Uniform mode is the older path that creates identical VMs and is the right answer only when the workload depends on legacy VMSS APIs or the Uniform-only Custom Script Extension pattern. Both modes support automatic instance repair, terminate notifications, and rolling upgrade policies. For workloads that do not need autoscale, an availability set with two or more instances still has its place: pair the VMs across fault domains and update domains, accept that the SLA is lower than zonal deployment, and use it for licensing-constrained software that does not handle scale-set churn.

    💡 Exam Trap: Availability sets give an SLA against simultaneous hardware faults and host updates inside a single datacenter. They do NOT protect against a zone outage. If the scenario states "the application must remain available if a datacenter in the region fails", the answer is Availability Zones or a zone-redundant Flexible VMSS, not an availability set.

    📊 Limit: A single Flexible VMSS supports up to 1,000 VM instances when all instances are in a single placement group, and the scale set itself can span all three availability zones in a supported region. A single availability set supports up to 200 VMs and is bounded to a single datacenter.

    Recommend a solution for automating the deployment of applications

    Automated deployment for VM-based workloads has two layers. The infrastructure layer authors VMs, disks, networks, and identities through Azure Resource Manager templates, Bicep, or Terraform. Bicep is the answer when the team is Azure-only and wants tight integration with Azure Policy DeployIfNotExists effects and Microsoft Entra ID role assignments; Terraform is the answer when the same team also manages AWS or GCP and wants one tool. Both produce idempotent ARM deployments and both support what-if previews; a deployment script that uses az group create with a parameter file is the right answer for a repeatable change, never the portal.

    The configuration layer customises the OS and the application. The Azure Image Builder service runs HashiCorp Packer behind the scenes to bake a managed-image or Azure Compute Gallery version from a Linux or Windows base, applying Chef, Ansible, or PowerShell DSC steps in a controlled pipeline; this is the right answer when the goal is an immutable image that can be promoted across dev, test, and production. Custom Script Extension and Run Command are the right answer for ad-hoc, post-boot configuration that does not warrant a new image. Azure Automation State Configuration applies a DSC pull-server model; Azure Automanage Machine Configuration replaces it for new builds and uses Microsoft Entra ID for authentication and a richer audit trail.

    For application binaries themselves, Azure DevOps Pipelines or GitHub Actions are the right answer. The pattern is to build artefacts in the pipeline, upload them to Azure Storage or Azure Container Registry, then either deploy via a Deployment Slot for App Service or roll out to VMs via the Azure CLI az vmss extension set command. Blue/green at the VMSS level is achieved by deploying a second scale set behind the same Application Gateway backend pool and switching the weight; canary at the application layer is achieved with feature flags from Azure App Configuration, covered later in this chapter.

    // Bicep: Flexible VMSS spanning three zones with automatic instance repair
    resource vmss 'Microsoft.Compute/virtualMachineScaleSets@2024-03-01' = {
     name: 'vmss-payments-prd'
     location: resourceGroup().location
     zones: ['1', '2', '3']
     sku: {
     name: 'Standard_D8as_v5'
     capacity: 6
     }
     properties: {
     orchestrationMode: 'Flexible'
     platformFaultDomainCount: 1
     automaticRepairsPolicy: {
     enabled: true
     gracePeriod: 'PT30M'
     repairAction: 'Replace'
     }
     upgradePolicy: {
     mode: 'Rolling'
     rollingUpgradePolicy: {
     maxBatchInstancePercent: 20
     maxUnhealthyInstancePercent: 20
     maxUnhealthyUpgradedInstancePercent: 20
     }
     }
     virtualMachineProfile: {
     storageProfile: {
     imageReference: {
     id: galleryImageVersionId
     }
     osDisk: {
     createOption: 'FromImage'
     managedDisk: { storageAccountType: 'PremiumV2_LRS' }
     }
     }
     networkProfile: {
     networkApiVersion: '2022-11-01'
     networkInterfaceConfigurations: [
     {
     name: 'nic01'
     properties: {
     primary: true
     ipConfigurations: [
     {
     name: 'ipcfg01'
     properties: {
     subnet: { id: paymentsSubnetId }
     applicationGatewayBackendAddressPools: [{ id: appGwBackendPoolId }]
     }
     }
     ]
     }
     }
     ]
     }
     }
     }
    }
    
    # Pipeline-driven update: bake a new image, then update the VMSS in rolling waves
    az image builder run --name img-payments-202506 --resource-group rg-images
    az vmss update \
     --resource-group rg-payments-prd \
     --name vmss-payments-prd \
     --set virtualMachineProfile.storageProfile.imageReference.id=$NEW_IMG_ID
    az vmss rolling-upgrade start \
     --resource-group rg-payments-prd \
     --name vmss-payments-prd
    

    Recommend a connectivity solution that connects Azure resources to on-premises networks

    Hybrid connectivity for VM workloads breaks into three options. Azure VPN Gateway with a route-based site-to-site IPsec tunnel is the answer when the on-premises bandwidth requirement is below approximately 10 Gbps aggregate, the customer already owns a compatible on-premises VPN appliance, and a small, predictable monthly cost matters more than guaranteed latency. The VpnGw5 SKU lifts aggregate throughput; active-active mode is the right answer when both customer edges should carry traffic simultaneously. Azure ExpressRoute is the answer when the workload needs guaranteed bandwidth at gigabit or higher, a 99.95% SLA on the link itself, and data residency that excludes the public internet. ExpressRoute Direct adds a 10 Gbps or 100 Gbps port pair into Microsoft's edge for the largest tenants. ExpressRoute FastPath bypasses the gateway data plane for latency-sensitive traffic.

    When the design needs many spokes, many regions, and many branches, Azure Virtual WAN is the right answer because it folds VPN, ExpressRoute, and SD-WAN connections into one managed hub-and-spoke fabric with global transit. The hub-and-spoke VNet topology built from raw VPN Gateway and ExpressRoute Gateway resources is the right answer for tighter control or for designs that pre-date Virtual WAN, but new green-field landing zones with more than a handful of spokes belong on Virtual WAN.

    ⚠️ Anti-Pattern: Designing site-to-site VPN as the only hybrid path for a regulated workload that requires private connectivity off the public internet. The VPN payload is encrypted, but the underlay is still the public internet and the path is best-effort. Use ExpressRoute with Microsoft peering disabled and Private peering only for compliance scenarios that exclude the internet.

    🎯 Scenario: A retailer runs a Windows-based merchandising application that authenticates against an on-premises Active Directory forest with a non-routable namespace, needs to mount an on-premises SMB share, and is migrating one store cluster at a time. The right design is a Flexible VMSS in the Azure region nearest the data centre, an ExpressRoute circuit with Private peering for the AD and SMB traffic, an Azure Private DNS Resolver forwarding the on-premises namespace, and Microsoft Entra Domain Services for the cloud-native services that need Kerberos without exposing the production forest.

    💡 Exam Trap: ExpressRoute by default does NOT encrypt traffic at the transport layer. If the scenario requires encryption in transit over ExpressRoute, the correct answer is to overlay an IPsec tunnel with VPN Gateway over the ExpressRoute private peering, or to enable MACsec on ExpressRoute Direct ports.

    A decision anchor: choose a Flexible VMSS spanning availability zones when the workload is stateless, scale-set churn is acceptable, and the SLA target is the 99.99% zonal VM SLA. Choose an availability set when the SLA target is the 99.95% in-datacenter SLA, the licensing model forbids scale-set churn, and the workload is bounded to a single datacenter. Choose Azure Dedicated Host when the workload requires hardware isolation for licensing or regulatory reasons.


    Continue with the interactive course

    Track your progress, jump into practice questions and use the Shark AI tutor inside the Microsoft - Azure Solutions Architect Expert learning hub.