Azure Functions – Triggers

What is a Trigger?

A trigger determines how and when a function is invoked. Azure Functions provides a variety of built‑in triggers for different workloads such as HTTP requests, timers, queue messages, and more.

Supported Trigger Types

HTTP Trigger Example

This sample creates an HTTP‑triggered function that returns a greeting.

using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;

public static class HttpTriggerFunction
{
    [FunctionName("HelloWorld")]
    public static IActionResult Run(
        [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
        HttpRequest req)
    {
        string name = req.Query["name"];
        return new OkObjectResult($"Hello, {name ?? "World"}!");
    }
}
Show / Hide Full Code

Timer Trigger Example

Runs every minute and writes a log entry.

using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;

public static class TimerTriggerFunction
{
    [FunctionName("TimerExample")]
    public static void Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer,
                           ILogger log)
    {
        log.LogInformation($"Timer fired at: {DateTime.Now}");
    }
}

Try It Live

Use the sandbox below to test an HTTP trigger locally (simulated).