Serverless Event-Driven Architectures with Azure Functions
Master Azure Functions hosting plans, triggers, and bindings — the exam's favorite serverless topic explained with real-world analogies and code.
# Serverless Event-Driven Architectures with Azure Functions
*This article is Part 1, Chapter 1.2 of the **AZ-204 Exam Refresher** series. Here we tackle Azure Functions — Azure's primary serverless compute offering — covering hosting plans, triggers, and the binding system that eliminates boilerplate integration code.*
---
## Introduction
Imagine you have a vending machine. You don't pay rent on it 24/7 when nobody's buying snacks — you pay per transaction. Azure Functions works the same way: your code wakes up in response to an event, runs, and goes back to sleep. You're billed only for the execution time.
This model is powerful for things like image processing pipelines, webhook handlers, scheduled jobs, and event-driven workflows. The trick is knowing *when* to use Functions versus App Service — and the AZ-204 exam will test exactly that.
---
## Core Concepts
### Hosting Plans
The hosting plan determines *where* and *how* your function runs. Getting this wrong is a common production mistake and a favorite exam topic.
| Plan | Cold Start | Scale | Max Timeout | Best For |
|---|---|---|---|---|
| **Consumption** | Yes | Automatic, event-driven | 10 min (default 5 min) | Sporadic, bursty workloads |
| **Premium** | No (pre-warmed) | Automatic + pre-warmed | Unlimited | Low-latency, VNet, long-running |
| **Dedicated (App Service)** | No | Manual / autoscale | Unlimited | Predictable load, cost control |
| **Flex Consumption** | Minimized | Per-function scaling | Un