Key takeaway
- Build a serverless application on Azure with Functions, Storage and Logic Apps: current CLI steps, CORS, monitoring, cost and security, per Microsoft docs.
A serverless application on Azure is an app where you write the logic and Azure runs, scales and patches the servers behind it. The usual build is a static front end in Azure Storage, an HTTP API in Azure Functions, and events or workflows handled by Event Grid and Logic Apps.
This guide shows how the pieces fit, the commands to build a small web app end to end, and how to monitor, secure and cost it. It is the hands-on companion to our Azure Serverless Computing guide, which compares hosting plans and architecture in depth. All Azure facts below come from Microsoft Learn pages read on 13 November 2026, so confirm limits and regions on the official page before you build.
What is serverless computing, and how does it differ from PaaS?
Serverless means you deploy code or workflows and pay for the work done, not for servers you keep running. With function-as-a-service (FaaS) each function is a small unit that scales on its own. With a classic platform-as-a-service (PaaS) web app you deploy the whole application as one unit and scale it as one unit.
Serverless on Azure is not one product. Microsoft's own scale guide lists several Functions hosting options (Flex Consumption, Premium, Dedicated and Container Apps, plus a legacy Consumption plan), each with different limits, networking and billing. See Azure Functions hosting options.
Which Azure services make up a serverless application?
Most serverless applications on Azure combine four building blocks. Pick the smallest set that does the job.
| Service | What it does | When it fits | Source |
|---|---|---|---|
| Azure Functions | Runs your code on a trigger such as HTTP, a queue message, an event or a timer | API endpoints, event handlers, scheduled jobs | Functions overview |
| Azure Logic Apps | Visual workflow designer with connectors. Consumption runs one workflow per resource on the multitenant service; Standard runs multiple workflows on single-tenant hosting with virtual network support | System integration with little code | Logic Apps plan comparison |
| Azure Event Grid | Publish-subscribe event routing over HTTP and MQTT, using the CloudEvents 1.0 format | Fan out events to functions and workflows | Event Grid overview |
| Static website in Azure Storage | Serves HTML, CSS and JavaScript from the $web container with no web server | A simple public front end for a function API | Static website hosting |
| Azure Static Web Apps | Hosting with GitHub-based CI/CD, built-in authentication and managed Functions APIs | A front end that needs sign-in, headers or pull-request previews | Static Web Apps overview |
| Azure Container Apps | Serverless containers with scale to zero, built on Kubernetes, Dapr and KEDA, with no direct Kubernetes API access | You need a custom container image or GPU workloads | Container Apps overview |
For the equivalent services on other clouds, see our guides to AWS serverless computing, Google Cloud serverless computing and OpenFaaS with Java for a container-based option. The wider concept is covered in Introduction to Serverless Computing.
Which Azure Functions hosting plan should a new app use?
Microsoft's guidance is to use Flex Consumption for new serverless function apps. The Consumption plan is described as legacy, and Linux Consumption hosting is documented as retiring on 30 September 2028, with no new features or language versions meanwhile. See Consumption plan and Flex Consumption plan.
| Plan | Key facts from Microsoft Learn | Choose it when |
|---|---|---|
| Flex Consumption | Linux only; virtual network integration; optional always-ready instances; scales up to 1,000 instances; billed per execution and active memory, or for always-ready baseline | Default for new event-driven and HTTP workloads |
| Premium | Elastic Premium SKUs start with "E"; at least one billed instance; billed on core-seconds and memory | Warm instances and steady load on a predictable bill |
| Dedicated | Runs on App Service plan capacity | You already run spare App Service capacity |
| Container Apps | Bring your own container; KEDA and Dapr; GPUs available | Custom runtime or microservices alongside functions |
| Consumption (legacy) | Windows still available; Linux Consumption retiring 30 September 2028; no virtual network integration | Existing apps only. Plan migration |
Flex Consumption does not support the in-process .NET model, and Microsoft documents that in-process support ends on 10 November 2026, so new .NET functions should use the isolated worker model (confirm on the official page).
How do you build a serverless web app on Azure, step by step?
The example below is a small web page that sends a name to an HTTP function and shows the reply. Replace every placeholder in angle brackets. Commands follow the current Azure CLI reference and Functions quickstart, so check the linked page if a flag has changed.
Step 1. Create a resource group and a storage account for the front end
A resource group holds everything for the app, so you can delete it in one step when you finish.
az group create --name <resource-group> --location <region>
az storage account create --name <web-storage-name> --resource-group <resource-group> \
--location <region> --sku Standard_LRS
Storage account names must be 3 to 24 characters of lowercase letters and numbers and unique in Azure. Static website hosting is not on by default. Enable it with the Azure CLI, or in the portal under Data management, Static website:
az storage blob service-properties update --account-name <web-storage-name> \
--static-website --index-document index.html --404-document 404.html
This creates the $web container. According to Microsoft Learn, files in it are served through anonymous read requests, names are case-sensitive, and enabling the feature is free: you pay for the blob storage and operations. Reference: Host a static website in Azure Storage.
Step 2. Create the function app on Flex Consumption
Create a separate storage account for the Functions host, then the function app. The quickstart creates a user-assigned managed identity for the host's storage access instead of using a shared key, and we recommend following it exactly: Create a function in Azure from the command line. The core command is:
az functionapp create --resource-group <resource-group> --name <app-name> \
--flexconsumption-location <region> --runtime node --runtime-version <version> \
--storage-account <host-storage-name> \
--deployment-storage-auth-type UserAssignedIdentity \
--deployment-storage-auth-value <identity-name>
Use az functionapp list-flexconsumption-locations to see which regions support the plan. The command also creates an Application Insights instance in the same resource group.
Step 3. Write and publish an HTTP function
Create a project with Azure Functions Core Tools, add an HTTP trigger, test it locally, then publish it.
func init --worker-runtime node --language javascript
func new --name HttpExample --template "HTTP trigger" --authlevel "function"
func start
func azure functionapp publish <app-name>
The local host listens on port 7071 and exposes the function at /api/HttpExample. Pick the language your team already supports; Microsoft Learn shows the same flow for C#, Java, Python, PowerShell and TypeScript.
Step 4. Allow the front end to call the function (CORS)
Browsers block calls from one origin to another unless the API allows it. Add the static website's primary endpoint to the function app's allowed origins, which makes Azure add the Access-Control-Allow-Origin header to HTTP responses. See Manage your function app.
az functionapp cors add --name <app-name> --resource-group <resource-group> \
--allowed-origins https://<web-storage-name>.<zone>.web.core.windows.net
Avoid the * wildcard in production; list the exact origins. Microsoft notes the Storage CORS feature itself is not supported for the static website endpoint, so the rule belongs on the function app.
Step 5. Build the HTML front end and upload it
The page needs a form with one text input and an empty output element. A short script posts the value to the function and writes the reply into the page:
const res = await fetch('https://<app-name>.azurewebsites.net/api/HttpExample', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: document.getElementById('name').value })
});
document.getElementById('output').textContent = await res.text();
Upload the files to the $web container:
az storage blob upload-batch --source <local-folder> --destination '$web' \
--account-name <web-storage-name>
If the browser downloads the page instead of showing it, the content type is wrong; Microsoft Learn suggests adding --content-type 'text/html; charset=utf-8'.
Step 6. Test, then secure the call
Open the static website's primary endpoint, submit a name and check the reply. Then deal with the key: a function-level access key sent from browser code can be read by anyone using the page, so treat it as a throttle, not as authentication. For real access control, use the App Service authentication that Functions supports with Microsoft Entra ID, or use Azure Static Web Apps, which adds sign-in and managed APIs. A storage-hosted static website does not support Entra ID and only allows anonymous reads.
How do you monitor a serverless application on Azure?
Start with Application Insights. Functions integrates with it to collect requests, exceptions, dependencies and performance data, and Microsoft recommends the Azure Monitor OpenTelemetry exporter for new and existing apps, with the classic Application Insights SDKs marked legacy. Sampling is on by default, so a missing log line may be sampled out. See Monitor executions in Azure Functions.
| Tool | Use it for | Note |
|---|---|---|
| Application Insights | Requests, failures, dependency calls, Live Metrics | Free daily data limit applies; check billing |
| Azure Monitor metrics and diagnostic settings | Platform metrics, and sending logs to a Log Analytics workspace | Log queries use Kusto Query Language |
| Kudu advanced tools | Inspecting the app, settings and deployment from the SCM endpoint, for troubleshooting | Not a monitoring tool |
| Azure Monitor Agent | Collecting data from machines | Replaces the Log Analytics agent (MMA/OMS), retired on 31 August 2024 |
Sources: Manage your function app (Kudu) and Migrate to Azure Monitor Agent.
Can you build the image-analysis example with Logic Apps and no code?
Yes, a Logic Apps workflow can trigger on an event, call a connector and send an email without code, which is why it suits integration work. Check the service you plan to call first. The Azure Face service is Limited Access: Microsoft states it is available only to Microsoft managed customers and partners after an intake form, and lists age among limited capabilities and emotion and gender as retired. Read the Face transparency note and your legal obligations for biometric data before you design around faces. Sources: What is the Azure Face service?.
Where do AI agents fit in a serverless Azure application?
An HTTP function is a natural place to run the actions an AI agent asks for. In Anthropic's tool-use documentation, client tools run in your application: Claude returns a tool_use block with a name and input, your code runs the operation and sends back a tool_result. A function app can host that code, with Event Grid or a queue triggering follow-up work. For long-running agent workflows, the Durable Task framework supports durable execution over hours, days or months, including multi-agent patterns. Sources: Claude tool use overview and What is Durable Task.
The trade-off is control. Every function an agent can reach is a new action to authorise, log and review. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and ElixirClaw is an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control.
What should you check on cost, security and governance?
| Area | What to check | Source |
|---|---|---|
| Cost | Flex Consumption bills execution and active memory, with a free monthly grant for on-demand and none for always-ready; static website hosting itself is free, you pay for storage and operations | Flex Consumption |
| Identity | Use managed identity for the Functions host storage connection instead of shared keys | Quickstart |
| Network | Flex, Premium and Dedicated support virtual network integration and private endpoints; Consumption does not | Hosting options |
| Front end | Storage static sites cannot set headers without Azure CDN and have no authentication; use Static Web Apps if you need either | Static website hosting |
| Private endpoints | A blob private endpoint blocks public access to the static site; the site needs its own private endpoint for the web domain | Static website FAQ |
| Retirements | Linux Consumption (30 Sep 2028) and Azure Cache for Redis Basic, Standard and Premium (30 Sep 2028) have documented retirement dates; check yours | Redis retirement FAQ |
When is serverless on Azure the wrong choice?
Serverless is a poor fit when you need a long-lived process with local state, a runtime Functions does not support, or very tight latency with no warm instances. Consumption-style plans have short default time limits, HTTP calls are capped at 230 seconds, and Azure Functions does not support Windows containers. In those cases consider Premium, Container Apps or a Kubernetes service. Our Azure Kubernetes Service guide covers that route, and Microsoft Azure managed services describes how we run these platforms.
What is a sensible adoption sequence?
1. Pick one low-risk API or event handler. 2. Build it on Flex Consumption with managed identity and Application Insights from day one. 3. Put the front end on Static Web Apps if users must sign in. 4. Add Event Grid or Logic Apps only when a second system needs the event. 5. Review cost and retirements every quarter against the Microsoft pages linked above.
To map one serverless action your agents should take, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is a serverless application on Azure?
It is an app built from managed services such as Azure Functions, Logic Apps, Event Grid and Azure Storage, where Azure runs and scales the servers and you pay for the work done.
Which Azure Functions plan should a new app use?
Microsoft recommends Flex Consumption for new serverless apps. The Consumption plan is legacy, and Linux Consumption hosting is documented as retiring on 30 September 2028.
Why does my browser block calls to my function?
The browser enforces cross-origin rules. Add the front end's origin to the function app's allowed origins (CORS) so Azure returns the Access-Control-Allow-Origin header.
Can a static website in Azure Storage use Microsoft Entra sign-in?
No. According to Microsoft Learn it supports only anonymous read access. Use Azure Static Web Apps if you need authentication or custom headers.
How do I monitor an Azure Functions app?
Use Application Insights, which Functions integrates with. Microsoft recommends the Azure Monitor OpenTelemetry exporter for new and existing apps and treats the classic SDKs as legacy.
Can AI agents call Azure Functions?
Yes, as your own code. In Anthropic's documentation, client tools run in your application, so an HTTP function can execute the operation and return the result. Authorise and log each action.
Next Steps with Serverless Application on Azure
Talk to our experts about implementing compound AI system, How Industries and different departments use Agentic Workflows and Decision Intelligence to Become Decision Centric. Utilizes AI to automate and optimize IT support and operations, improving efficiency and responsiveness.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE