Azure Compute Serverless Documentation

Explore the power of serverless computing on Azure, allowing you to build and run applications without managing infrastructure. Focus on your code, and let Azure handle the scaling, availability, and management.

What is Serverless Computing?

Serverless computing is a cloud execution model where the cloud provider dynamically manages the allocation and provisioning of servers. Developers write and deploy code without needing to worry about the underlying infrastructure.

Key Azure Serverless Compute Services

Azure Functions

A serverless compute service that enables you to run small pieces of code, or "functions," in the cloud. Ideal for event-driven workloads, microservices, and automating tasks.

Learn More

Azure Logic Apps

A cloud-based service that helps you automate workflows and integrate apps, data, and services. Visually design and build automated processes without writing code.

Learn More

Azure Container Instances (ACI)

Run containers in Azure without managing virtual machines or orchestration platforms. Quick, easy, and cost-effective for simple containerized applications.

Learn More

Azure Kubernetes Service (AKS) - Serverless

While AKS is a managed Kubernetes service, it offers serverless options like virtual nodes, allowing you to run pods without managing underlying VMs.

Learn More

Getting Started with Azure Functions

Azure Functions provide a powerful and flexible way to implement serverless solutions. Here's a basic example of a C# function triggered by an HTTP request.

using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

public static class HttpTriggerCSharp
{
    [FunctionName("HttpTriggerCSharp")]
    public static async Task Run(
        [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
        ILogger log)
    {
        log.LogInformation("C# HTTP trigger function processed a request.");

        string name = req.Query["name"];

        string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
        dynamic data = JsonConvert.DeserializeObject(requestBody);
        name = name ?? data?.name;

        string responseMessage = string.IsNullOrEmpty(name)
            ? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
            : $"Hello, {name}! This HTTP triggered function executed successfully.";

        return new OkObjectResult(responseMessage);
    }
}
                

This function can be deployed to Azure and invoked via HTTP. You can then integrate it with other Azure services to build complex serverless architectures.

Create Your First Azure Function

Use Cases for Serverless Compute