0PricingLogin
Azure Fundamentals · Lesson

Azure Functions Triggers and Bindings

Write an HTTP-triggered function, add an output binding to write to Azure Queue Storage, and understand the Consumption Plan's automatic scaling model.

What Are Azure Functions?

Azure Functions is a serverless compute service that lets you run small units of code (functions) in response to events without managing any infrastructure. You pay only for the execution time and memory used while your function runs — there is no cost when the function is idle. Functions are ideal for event-driven tasks, lightweight APIs, scheduled jobs, and integrating cloud services without a persistent server.

Triggers: What Starts a Function

Every Azure Function must have exactly one trigger that defines the event causing it to execute. Common triggers include HTTP (incoming HTTP request), Timer (CRON schedule), Blob Storage (new blob in a container), Queue Storage (new message in a queue), Event Hub (stream of events), Service Bus (queue/topic message), and Cosmos DB (change feed). The trigger receives the event data and passes it to your function code.

// HTTP trigger function (JavaScript/Node.js)
module.exports = async function (context, req) {
  const name = req.query.name || (req.body && req.body.name);
  const message = name ? 'Hello, ' + name : 'Pass a name in the query or body';
  context.res = {
    status: 200,
    body: { message }
  };
};

All lessons in this course

  1. Azure Functions Triggers and Bindings
  2. Durable Functions for Stateful Workflows
  3. Azure Logic Apps
  4. Event Grid and Event-Driven Architecture
← Back to Azure Fundamentals