AZ-900Chapter 45 of 127Objective 1.2

Serverless Computing Concepts

This chapter covers serverless computing concepts in Microsoft Azure, a fundamental pillar of cloud computing that enables developers to build applications without managing infrastructure. For the AZ-900 exam, this topic falls under Objective 1.2 (Describe cloud service types) and is tested alongside IaaS, PaaS, and SaaS. Understanding serverless is critical because it represents a distinct consumption-based model where code runs only in response to events and you pay only for execution time. While serverless may appear in only 5-10% of AZ-900 questions, those questions often include tricky distinctions between serverless and PaaS, or between Azure Functions and Logic Apps. This chapter will give you the precise definitions, service names, and exam traps you need to answer confidently.

25 min read
Beginner
Updated May 31, 2026

The Food Truck vs. Full-Service Restaurant

Imagine you want to sell gourmet burgers. A full-service restaurant requires you to lease a building (provision servers), hire a permanent chef (OS maintenance), buy industrial ovens (compute resources), and pay for utilities even when the restaurant is empty (idle capacity). You must manage everything: menu changes (software updates), deep cleaning (security patches), and equipment repairs (hardware failures). Now consider a food truck. You park where the crowd is (event-driven scaling), cook only when customers order (pay-per-execution), and you don't own the truck—you rent it from a company that handles maintenance (serverless platform). If nobody orders for an hour, you sit idle at zero cost (no charge when no code runs). The food truck model is serverless: you focus on the recipe (your code), and the platform handles the truck, fuel, permits, and cleaning. Just as a food truck can appear at a festival with thousands of hungry people and serve them all without building a permanent kitchen, Azure Functions can handle a sudden spike in traffic without you provisioning any servers. The mechanism is identical: an event (customer order / HTTP request) triggers execution, resources are allocated on the fly, and you pay only for the cooking time (execution duration).

How It Actually Works

What Is Serverless Computing and the Business Problem It Solves

Serverless computing is a cloud execution model where the cloud provider dynamically manages the allocation and provisioning of servers. The name "serverless" is a misnomer—servers still exist, but the developer never sees, manages, or provisions them. The core business problem serverless solves is the overhead of infrastructure management. In traditional on-premises or even IaaS models, teams must provision VMs, configure networking, apply OS patches, monitor disk space, and plan for capacity. This distracts from writing business logic. Serverless eliminates that overhead entirely. The developer writes code (or configures workflows) and defines what event triggers that code—an HTTP request, a timer, a new file in blob storage, a message in a queue. Azure then automatically runs the code on a managed compute resource, scales it to handle demand, and charges only for the resources consumed during execution. This is ideal for event-driven workloads, microservices, APIs, and automated tasks that run infrequently or unpredictably.

How Serverless Works in Azure – Step by Step

Azure offers two primary serverless compute services: Azure Functions and Azure Logic Apps. Azure Functions is a serverless compute service that runs code (in C#, JavaScript, Python, PowerShell, etc.) triggered by events. Azure Logic Apps is a serverless workflow service that uses a visual designer to orchestrate and automate business processes without writing code. Both follow the same fundamental mechanism:

1.

Trigger: An event occurs—an HTTP request arrives, a message is added to a queue, a blob is uploaded, a timer fires. This trigger activates the function or logic app.

2.

Allocation: Azure automatically allocates compute resources (CPU, memory) from a shared pool to run the code. The function app runs in a sandboxed environment called a "host." The host is managed by the Azure Functions runtime.

3.

Execution: The code runs to completion. For Azure Functions, the execution is limited by a configurable timeout (default 5 minutes, max 10 minutes for the Consumption plan; up to 60 minutes for the Premium plan). For Logic Apps, workflows can run longer because they are stateful and can persist between steps.

4.

Scaling: If multiple events occur simultaneously, Azure automatically creates multiple instances of the function app to handle them in parallel. The scale is driven by the number of events, not by manual configuration.

5.

Billing: You are billed only for the resources consumed during execution—measured in gigabyte-seconds (GB-s) for Functions (memory × execution time) and per action for Logic Apps. When no code runs, you pay nothing.

Key Components and Pricing Tiers

#### Azure Functions Plans

Consumption Plan: The default serverless plan. You pay only for execution time (per-second billing). Scaling is automatic and elastic, from zero to thousands of instances. Cold start (the delay when a function is invoked after being idle) can be noticeable because the host needs to load the runtime and your code. This plan is ideal for sporadic workloads with variable traffic.

Premium Plan: Provides pre-warmed instances to eliminate cold starts, offers more powerful compute (up to 4 vCPUs and 14 GB memory), and allows VNET integration for accessing resources inside a virtual network. You pay for a baseline number of instances (always-on workers) plus any additional execution. This plan is for enterprise workloads that require consistent performance and network isolation.

Dedicated (App Service) Plan: Functions run on a dedicated App Service plan, similar to a web app. You pay for the plan regardless of whether functions execute. This is not truly serverless (you provision the plan), but it's an option for existing App Service customers or for functions that need to run continuously.

#### Azure Logic Apps Plans

Consumption: Pay-per-execution model. Logic apps run in a multi-tenant environment. Billed per action and per connector execution. Suitable for simple, low-volume workflows.

Standard: Runs on dedicated App Service plan instances. Offers higher throughput, VNET integration, and private endpoints. Billed per hour for the plan. Better for enterprise-scale workflows.

Comparison to On-Premises Equivalent

In an on-premises environment, to run a similar event-driven job (e.g., resizing images when uploaded), you would need:

A server (physical or VM) running 24/7.

An operating system with file system monitoring.

A scheduled task or a service that polls for new files.

Manual scaling by adding more servers.

Capital expenditure for hardware and ongoing electricity, cooling, and maintenance.

With serverless, you write a function that triggers on blob creation, upload it to Azure, and Azure handles everything else. No server to patch, no capacity planning, no idle cost. The on-premises equivalent is like owning a car that you keep running in the driveway just in case you need to drive somewhere; serverless is like using a ride-sharing app—you only pay when you ride, and the car is maintained by the company.

Azure Portal and CLI Touchpoints

In the Azure Portal, you create a Function App (the container for your functions) via "Create a resource" > "Compute" > "Function App." You specify the runtime stack, region, and hosting plan. Inside the Function App, you can create functions using the portal's code editor or upload deployment packages. For Logic Apps, you create a Logic App resource and use the designer to add triggers and actions.

Using the Azure CLI, you can create a Function App with:

az functionapp create --resource-group myResourceGroup --consumption-plan-location westus --runtime python --runtime-version 3.9 --functions-version 4 --name myFunctionApp --storage-account mystorageaccount

For Logic Apps via CLI (limited), you typically use ARM templates or PowerShell.

Concrete Business Scenarios

E-commerce order processing: When a customer places an order, an HTTP request triggers an Azure Function that validates the order, writes to a database, and sends a confirmation email. The function scales automatically during peak sales.

Image processing pipeline: A user uploads a photo to Azure Blob Storage. A blob-triggered function automatically creates a thumbnail and stores it in a separate container. This runs only when uploads occur, costing near zero during quiet periods.

Scheduled data cleanup: A timer-triggered function runs every night to delete records older than 90 days from a database. The function runs once a day for a few seconds, costing pennies per month.

Walk-Through

1

Create a Function App

In the Azure Portal, navigate to 'Create a resource' and search for 'Function App.' Fill in the required fields: Subscription, Resource Group, Function App name, Runtime stack (e.g., .NET, Node.js, Python, Java), Version, Region, and Hosting options. For a true serverless experience, select 'Consumption (Serverless)' under Hosting. You also need to create or select a Storage Account—Azure Functions require an Azure Storage account for internal operations like managing triggers and logging. Behind the scenes, Azure provisions the necessary infrastructure to host your function code, including the Azure Functions runtime and a dynamic scaling controller. The creation typically takes 1-2 minutes.

2

Create a Function with a Trigger

Inside your Function App, click 'Functions' and then 'Create.' Choose a trigger type—the event that starts execution. Common triggers include: HTTP trigger (for REST APIs), Timer trigger (for scheduled tasks), Blob trigger (for file uploads to Azure Blob Storage), and Queue trigger (for messages in Azure Queue Storage). You give the function a name and set authorization level (for HTTP triggers) or other trigger-specific parameters. Azure then generates boilerplate code for the chosen trigger. For example, an HTTP trigger creates a function that accepts an HTTP request and returns a response. You can then modify the code in the portal's editor or download it for local development.

3

Write and Test the Function Code

Replace the default code with your business logic. For a Python HTTP trigger, the function signature includes an `HttpRequest` and returns an `HttpResponse`. You can add libraries by including a `requirements.txt` file. Test the function by clicking 'Test/Run' in the portal—you can send a sample HTTP request or simulate a blob upload. Azure runs the function in a sandboxed environment and returns the output. You can also view logs in the 'Monitor' tab to see execution details and errors. Note that for the Consumption plan, the first invocation after a period of inactivity may experience a cold start (a few seconds delay) as Azure loads the runtime.

4

Configure Scaling and Monitoring

Scaling is automatic for the Consumption and Premium plans. You don't need to configure instance counts. However, you can set limits: for the Premium plan, you specify a minimum and maximum number of instances. For monitoring, navigate to 'Application Insights' under the Function App settings to enable telemetry. Application Insights collects data on function executions, durations, failures, and dependencies. You can set up alerts for high error rates or long durations. In the portal, the 'Monitor' tab shows a summary of recent invocations. For detailed analysis, query Application Insights with Kusto Query Language (KQL).

5

Deploy to Production and Manage Costs

For production deployment, use continuous integration tools like Azure DevOps or GitHub Actions to deploy code automatically. You can also deploy from VS Code using the Azure Functions extension. For cost management, monitor execution count and duration in the 'Cost Analysis' section of your subscription. The Consumption plan bills per execution and per GB-second. For example, a function that runs 1 million times per month with 128 MB memory and 1-second average duration would cost roughly $0.20–$0.30. To avoid surprises, set budget alerts and consider using the Premium plan if you need predictable costs (fixed baseline plus variable). Also, note that the first 1 million executions per month are free for Azure Functions under the Consumption plan (as of 2024).

What This Looks Like on the Job

Scenario 1: E-commerce Order Processing

An online retailer uses Azure Functions to process incoming orders. When a customer clicks 'Place Order,' an HTTP request triggers a function that validates the order (check inventory, apply discounts), writes order details to a SQL database, and sends a confirmation email via SendGrid. The team configures the function with an HTTP trigger and sets the authorization level to 'Function' (requires a key). They deploy the function using Azure DevOps. During Black Friday, traffic spikes to 10,000 orders per minute. The Consumption plan automatically scales to hundreds of instances, processing each order in under 200 ms. The cost for that day is about $50—far less than provisioning VMs to handle peak load. What goes wrong? If the function has unhandled exceptions (e.g., database connection timeouts), it may fail silently. The team must implement retry logic and monitor Application Insights for failures. Also, if the function takes longer than the default 5-minute timeout for long-running orders (e.g., generating PDFs), it times out. They solve this by using Durable Functions (an extension for orchestrating long-running workflows) or increasing the timeout to 10 minutes.

Scenario 2: Automated Image Thumbnail Generation

A social media app allows users to upload profile photos. Each upload triggers a blob-triggered Azure Function that resizes the image to 150x150 pixels and stores the thumbnail in a separate container. The function is written in Node.js and uses the Sharp library. The team sets up the function with a Blob trigger on the 'uploads' container. The function runs only when a new blob appears. During a promotion that drives 50,000 uploads in a day, the function scales automatically. The cost is minimal—each execution takes ~500 ms and uses 128 MB memory. The problem: if the original image is deleted before the function runs (a race condition), the function fails. The team adds error handling and uses blob leases to ensure the blob is not deleted during processing. Another issue: cold starts cause a 2-3 second delay for the first upload after hours of inactivity. Users notice a lag. The team mitigates this by enabling the Premium plan with pre-warmed instances, or by using a warm-up trigger (a timer function that runs every few minutes to keep the host alive).

Scenario 3: Scheduled Data Cleanup

A healthcare SaaS company needs to delete patient records older than 7 years to comply with data retention policies. They create a timer-triggered Azure Function that runs daily at 2:00 AM. The function queries a Cosmos DB database, deletes old records, and logs the number of deletions. The function runs on the Consumption plan—it executes for about 30 seconds each night and costs less than $0.01 per month. What goes wrong? If the function encounters a transient error (e.g., Cosmos DB throttling), it may fail to delete all records. The team implements retry logic with exponential backoff. Also, if the timer trigger's schedule is misconfigured (e.g., using UTC instead of local time), records may be deleted at the wrong hour. They test the function with a manual invocation and check the logs.

How AZ-900 Actually Tests This

What AZ-900 Tests on Serverless Computing (Objective 1.2)

The AZ-900 exam expects you to understand serverless as a distinct cloud service model (alongside IaaS, PaaS, and SaaS) and to identify its characteristics, benefits, and use cases. Specifically, you should know:

Serverless is a code-first model where you write code and don't manage infrastructure.

Azure Functions and Azure Logic Apps are the two main serverless services.

Serverless is event-driven and scales automatically.

Billing is consumption-based (pay per execution or per GB-second).

Serverless can be part of a microservices architecture.

The exam may ask you to differentiate serverless from PaaS. Remember: PaaS still involves managing the application and data, but the platform manages the runtime. With serverless, you don't even manage the runtime—Azure handles the entire execution environment.

Common Wrong Answers and Why Candidates Choose Them

1.

"Serverless means no servers are involved." This is the most common trap. Candidates think the name is literal. Reality: servers exist but are abstracted away; you never see or manage them.

2.

"Azure Virtual Machines are a serverless service." Candidates confuse 'no management' with IaaS. VMs require you to manage the OS and applications. Serverless requires no such management.

3.

"Azure Functions and Logic Apps are the same thing." They are both serverless but serve different purposes: Functions run custom code; Logic Apps are for workflows with built-in connectors (no code). The exam may ask which service to use for a given scenario.

4.

"Serverless is always cheaper than IaaS." Not true—for predictable, high-constant workloads, a dedicated VM or App Service plan can be cheaper. Serverless is cost-effective for sporadic or variable workloads.

5.

"Serverless has no limitations." Serverless has limits: execution timeout (max 10 min for Consumption, 60 min for Premium), memory (max 1.5 GB for Consumption), and cold starts. The exam may test these constraints.

Specific Terms and Values That Appear Verbatim

Azure Functions: The serverless compute service for event-driven code.

Azure Logic Apps: The serverless workflow service for orchestrating processes.

Consumption Plan: The pay-per-execution hosting plan for Azure Functions.

Cold Start: The delay when a function is invoked after being idle.

Trigger: The event that starts execution (HTTP, Timer, Blob, Queue).

Bindings: Declarative connections to data sources (input/output).

Durable Functions: An extension for orchestrating stateful, long-running workflows.

Edge Cases and Tricky Distinctions

Serverless vs. PaaS: Both abstract infrastructure, but PaaS (e.g., Azure App Service) still requires you to manage the app runtime (e.g., choose an app stack, configure scaling rules). Serverless manages the runtime entirely.

Azure Functions vs. Logic Apps: If the question involves custom code (e.g., C#, Python), choose Functions. If it involves connecting SaaS services with a visual designer (e.g., send email on new file), choose Logic Apps.

Consumption vs. Premium Plan: The exam may ask when to use Premium—answer: when you need no cold starts, VNET integration, or longer execution times (up to 60 minutes).

Serverless and Containers: Serverless can run containers via Azure Container Instances or Azure Functions on Kubernetes (KEDA), but the core serverless experience is code-based.

Memory Trick for Eliminating Wrong Answers

Use the S.E.A. rule: Serverless = Scale automatically, Event-driven, Abstracted infrastructure. If an answer mentions managing servers, OS patching, or capacity planning, it's not serverless. If it mentions paying for idle time, it's not serverless.

Key Takeaways

Serverless computing abstracts server management; you only write code or define workflows.

Azure Functions is the serverless compute service for event-driven code execution.

Azure Logic Apps is the serverless workflow service for integrating SaaS applications.

The Consumption plan for Azure Functions bills per execution and per GB-second; first 1 million executions per month are free.

Cold start is a delay when a function is invoked after being idle; mitigated by the Premium plan.

Serverless is ideal for variable or unpredictable workloads; for constant high load, consider dedicated plans.

AZ-900 expects you to differentiate serverless from PaaS: serverless manages the runtime, PaaS manages the platform.

Common exam trap: 'serverless means no servers' is false.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Azure Functions

Runs custom code (C#, Python, JavaScript, etc.)

Triggered by events (HTTP, timer, blob, queue, etc.)

Billed per execution and GB-second (Consumption plan)

Requires coding skills to implement business logic

Best for microservices, APIs, and data processing

Azure Logic Apps

Visual workflow designer with no-code/low-code

Triggered by events and connectors (e.g., email, CRM)

Billed per action and connector execution

Uses pre-built connectors for SaaS integration

Best for business process automation and integration

Watch Out for These

Mistake

Serverless means there are no servers involved in running your code.

Correct

Servers are still used to execute code, but they are fully managed by Azure. The developer never provisions, configures, or patches servers. The term 'serverless' refers to the developer's experience—they don't see or manage servers.

Mistake

Azure Functions and Azure Logic Apps are interchangeable and do the same thing.

Correct

They are both serverless but serve different purposes. Azure Functions runs custom code (e.g., C#, Python, JavaScript) in response to events. Azure Logic Apps is a visual workflow designer that connects SaaS services (e.g., Office 365, Dynamics 365) without writing code. Use Functions for code-heavy logic; use Logic Apps for integration workflows.

Mistake

Serverless is always the cheapest option for any workload.

Correct

Serverless is cost-effective for sporadic or variable workloads because you pay only for execution. For high-volume, predictable workloads (e.g., a website with constant traffic), a dedicated App Service plan or VM can be cheaper because you pay a fixed hourly rate instead of per-execution costs.

Mistake

Azure Functions can run indefinitely without any time limits.

Correct

Azure Functions have execution timeouts. On the Consumption plan, the default timeout is 5 minutes, configurable up to 10 minutes. On the Premium plan, the maximum timeout is 60 minutes. For longer-running processes, use Durable Functions or offload to other services.

Mistake

Serverless applications cannot access resources inside a virtual network (VNet).

Correct

Azure Functions on the Premium plan and Dedicated plan support VNet integration, allowing functions to access resources like VMs, databases, and services inside a VNet. The Consumption plan does not support VNet integration. Logic Apps also support VNet integration on the Standard plan.

Frequently Asked Questions

What is serverless computing in Azure?

Serverless computing is a cloud execution model where Azure manages the infrastructure, and you only provide code or workflows. You don't provision or manage servers. Azure automatically scales resources based on demand and bills you only for the resources consumed during execution. The primary Azure serverless services are Azure Functions (for code) and Azure Logic Apps (for workflows).

What is the difference between Azure Functions and Azure Logic Apps?

Azure Functions is a compute service that runs custom code (e.g., C#, Python) in response to events. You write the logic yourself. Azure Logic Apps is a workflow service that uses a visual designer to connect SaaS applications (e.g., Office 365, Salesforce) with pre-built connectors—no coding required. Use Functions when you need custom processing; use Logic Apps when you need to orchestrate services.

What is a cold start in Azure Functions?

A cold start is the delay that occurs when a function is invoked after being idle for a period. During idle time, Azure may deallocate the function's host. When a new request arrives, Azure must load the runtime and your code, causing a delay (often 1-5 seconds). The Premium plan eliminates cold starts by keeping instances pre-warmed. The Consumption plan has cold starts but they are acceptable for many scenarios.

How is Azure Functions billed?

Azure Functions on the Consumption plan is billed based on two metrics: total number of executions and resource consumption (memory × execution time) measured in gigabyte-seconds (GB-s). The first 1 million executions and 400,000 GB-s per month are free. For example, a function with 128 MB memory running for 1 second consumes 0.125 GB-s. There is no charge when the function is idle.

Can Azure Functions access on-premises resources?

Yes, but only through specific networking features. Azure Functions on the Premium plan and Dedicated plan support VNet integration, which allows them to connect to resources inside a virtual network, including on-premises resources via VPN or ExpressRoute. The Consumption plan does not support VNet integration. Alternatively, you can use hybrid connections or on-premises data gateways.

What are the limitations of Azure Functions?

Key limitations include: execution timeout (5 min default, max 10 min on Consumption; up to 60 min on Premium), memory (max 1.5 GB on Consumption; up to 14 GB on Premium), file system access (temporary storage only), and cold starts. Also, the number of concurrent executions is limited by the plan (unlimited on Consumption, subject to instance limits).

What is Durable Functions?

Durable Functions is an extension of Azure Functions that allows you to write stateful, long-running workflows in code. It manages state, checkpoints, and restarts automatically. It's useful for orchestrating functions, human interaction patterns, and fan-out/fan-in scenarios. Durable Functions can run for hours or days.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Serverless Computing Concepts — now see how well it sticks with free AZ-900 practice questions. Full explanations included, no account needed.

Done with this chapter?