Azure Functions

What it is

Azure Functions is an event-driven, serverless compute service. You write small units of code that run when something happens—an HTTP request arrives, a timer fires, a queue receives a message, or a file changes—without operating the underlying servers. The hosting option still determines scaling, networking, capacity, and cost.

Why it exists

Many tasks are event-driven and bursty: an HTTP request, queue message, blob upload, or timer. A consumption-based plan can scale on demand; a dedicated or always-ready plan trades some scale-to-zero behavior for predictable capacity, networking, or reduced startup latency.

Key ideas

  • Triggers kick off functions: HTTP trigger, Timer, Azure Storage Queue/Blob/Event Hub triggers, Azure Service Bus, Event Grid, Cosmos DB, and more.
  • Bindings: declarative input/output bindings connect to other services (e.g. read from blob, write to queue) with minimal code.
  • Hosting options: Flex Consumption is Microsoft’s recommended plan for new serverless apps and provides event-driven scaling, VNet integration, and pay-as-you-go billing. Premium provides always-warm instances and VNet integration; Dedicated runs in an App Service plan; Container Apps can host customized containerized function apps. The older Consumption plan is legacy and Windows-only for new-app decisions.
  • Runs inside a Function App — the container grouped with app settings, identity, and runtime config.
  • Durable Functions orchestrate stateful, long-running workflows.
  • Runs on the Functions runtime; supports .NET, Java, Node, Python, PowerShell.

Northwind example

When a customer order is placed, Northwind writes a message to a queue. A queue-triggered function receives it, checks that the order has not already been processed, then requests shipment. The trigger starts the function; an output binding or SDK call can send the next message. Because messages can be retried, the processing code must be safe to run more than once. Azure runs the function host, but Northwind still owns the code, secrets, authorization, monitoring, and handling of failed work.

How it fits (diagram)

Exam notes

  • Serverless ≠ no server: Microsoft manages the servers, but the selected plan determines behavior and costs.
  • Choose a plan from requirements such as warm capacity, networking, scaling, and cost; do not assume every Function App has zero idle cost.
  • Triggers vs bindings: triggers start the function; bindings connect to input/output data.
  • AZ-104: recognize scope — Functions are the serverless compute in the compute spectrum, alongside ACI and AKS. Function Apps often run under an App Service plan (Dedicated) too.

Path MOC · app-service · aci · aks · function-triggers · azure-functions-bindings

📘 Source: Microsoft Learn — What is Azure Functions?