Design infrastructure solutions · Topic 2 of 10
Serverless and Batch Compute
AZ-305 serverless and batch: choose Azure Functions hosting plans, Logic Apps, Durable Functions and Container Apps jobs, and use Azure Batch for parallel workloads.
- 5 min
- Flex Consumption is the recommended plan for new Functions. Premium keeps warm instances and supports slots and containers. Dedicated is for existing plans.
- Durable Functions provide stateful orchestration in code. Logic Apps provide low code integration with connectors.
- Azure Batch runs large parallel jobs on managed VM pools, with Spot nodes for savings and MPI on RDMA sizes.
What it is
Serverless compute runs your code or workflow without you managing servers, scales with events and, in its purest form, bills only for use. Batch compute runs large numbers of similar tasks, often in parallel, such as rendering, simulations or nightly processing. The architect decides which serverless or batch service and which hosting plan match the trigger, duration, scale and networking needs.
How it works
Azure Functions
Functions run code in response to triggers (HTTP, timer, queue, Event Grid, Event Hubs, Cosmos DB change feed) with bindings for input and output.
| Hosting plan | Characteristics |
|---|---|
| Flex Consumption | The recommended plan for new serverless apps. Scales out to many instances, selectable instance memory, always ready instances to reduce cold start, virtual network integration. Linux only, and no deployment slots |
| Premium | Pre warmed workers with no cold start, VNet connectivity, longer run times, Linux containers, deployment slots |
| Dedicated (App Service plan) | Predictable billing or underused existing plans. No event driven scaling |
| Consumption (legacy) | Pay per execution, scale to zero. Being phased out for Linux |
| Functions on Container Apps | Custom containers, GPUs, KEDA scaling |
Choose Flex Consumption for new event driven code, Premium when you need warm instances, slots or containers, and Dedicated when you already pay for a plan with spare capacity. For code that needs high end compute or GPUs, host it on Container Apps.
Durable Functions and orchestration
Durable Functions add stateful workflows in code: function chaining, fan out and fan in, async HTTP APIs, human interaction and monitoring patterns. Use them when a process spans many steps with state, retries and long waits, and you prefer code over a designer.
Logic Apps and Event Grid
| Service | Fit |
|---|---|
| Azure Logic Apps | Low code workflow automation with hundreds of connectors (Microsoft 365, SAP, Salesforce, databases). Consumption (pay per action, multitenant) or Standard (single tenant, stateful or stateless, VNet integration, runs anywhere with Arc) |
| Azure Event Grid | Routes events to handlers such as Functions and Logic Apps (messaging page) |
| Azure Static Web Apps | Static front ends with serverless API back ends and built in auth |
| Power Automate | Citizen developer workflows in Microsoft 365 |
Pick Logic Apps for integration with SaaS and enterprise systems with little code. Pick Functions for custom code. They are often combined: Logic Apps calls a function for custom logic.
Container Apps jobs
Azure Container Apps jobs run containers to completion on a schedule, event or manual trigger. They fit short lived batch tasks without managing a cluster.
Azure Batch
Azure Batch is a managed service for large scale parallel and high performance computing: it creates a pool of VMs, schedules tasks from jobs onto nodes, scales the pool and cleans up.
| Feature | Detail |
|---|---|
| Use cases | Rendering, media transcoding, Monte Carlo simulation, genomics, financial modelling |
| Pools | Dedicated or Spot (low priority) nodes, autoscale formulas, custom images, containers |
| Multi instance tasks | MPI workloads on RDMA capable sizes (HB, HC, N series) |
| No cluster to manage | You pay only for the VMs while they run |
| Integration | Reads input from Storage, writes results back, and can run from Data Factory |
Compare with alternatives: VM scale sets give you the VMs but no task scheduler. AKS jobs or Container Apps jobs suit containerised batch. Azure CycleCloud orchestrates traditional HPC schedulers such as Slurm. Spot nodes make Batch very cheap for work that tolerates interruption and retries.
Choosing quickly
| Requirement | Answer |
|---|---|
| Run code when a message arrives, scale automatically, new project | Azure Functions on Flex Consumption |
| No cold start and private networking | Functions Premium |
| Connect Salesforce, SAP and Outlook with little code | Logic Apps |
| Multi step stateful process in code with long waits | Durable Functions |
| Render 10,000 frames in parallel at low cost | Azure Batch with Spot nodes |
| MPI simulation across many nodes | Azure Batch multi instance tasks on RDMA sizes |
| Nightly containerised job | A Container Apps job |
A worked scenario
A media company processes uploaded videos. An Event Grid event on blob upload triggers a Function (Flex Consumption) that validates the file and starts a Durable Functions orchestration. Transcoding runs as tasks on Azure Batch with Spot nodes and autoscale, and a Logic App posts the result to Teams and updates a CRM.
What to remember for the exam
- Flex Consumption is the recommended plan for new Functions. Premium keeps warm instances and supports slots and containers. Dedicated is for existing plans.
- Durable Functions provide stateful orchestration in code. Logic Apps provide low code integration with connectors.
- Azure Batch runs large parallel jobs on managed VM pools, with Spot nodes for savings and MPI on RDMA sizes.
- Container Apps jobs run containers to completion on schedules or events.
- Serverless suits spiky, event driven work. Steady heavy load can cost less on provisioned compute.
"Connectors to SaaS systems, little code" is Logic Apps. "Custom code on an event" is Functions.
How the exam asks about this
- "Run custom code on events with no servers." Azure Functions.
- "Orchestrate a long running multi step process in code with retries." Durable Functions.
- "Integrate Salesforce and SAP with minimal code." Logic Apps.
- "Run a huge parallel rendering job cheaply." Azure Batch with Spot nodes.
Common mistakes
Using Consumption plans for new apps. Flex Consumption is recommended.
Logic Apps for heavy custom algorithms. Use Functions.
Building a scheduler on VMs when Batch exists.
Spot nodes for work that cannot be retried.
Check yourself
Which Functions plan is recommended for new serverless apps?
Flex Consumption.
Which service runs large parallel HPC style jobs on managed VM pools?
Azure Batch.
What do Durable Functions add?
Stateful orchestration of workflows in code.
Topic 2 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.