function triggers

What it is

An Azure Functions trigger is the event that starts a function. Every function has exactly one trigger. The trigger also tells Azure Functions how to invoke the code and can provide the initial data.

Think of a doorbell. The doorbell starts the visit; the visitor’s package is the data that arrives with it. A function cannot wait for two doorbells at once as its trigger, but it can use other services after one doorbell rings.

Why it exists

Triggers let Azure run code when work arrives instead of requiring a developer to keep a server checking for changes. The trigger defines the starting condition: an HTTP request, a timer, a queue message, a blob change, or a message from another Azure service.

Key ideas

  • An HTTP trigger starts a function when a caller makes an HTTP request. It is useful for an API endpoint or webhook.
  • A timer trigger starts on a schedule, such as a nightly report.
  • A queue, Service Bus, Event Grid, blob, or Event Hubs trigger starts when its supported service supplies an event or message.
  • The trigger is an invocation mechanism, not a guarantee that the business work succeeded. A message-based function needs safe retries and monitoring.
  • The function’s hosting plan, permissions, network access, and binding configuration still affect whether an invocation can do useful work.

Northwind example

Northwind uses a Service Bus trigger for PickOrder messages. A completed checkout sends a message; that message starts the warehouse function and supplies the order ID. The function looks up the order, creates a picking task, and records success. If the worker fails, the messaging service can retry, so the code checks whether the task already exists.

Trigger versus binding

QuestionAnswer
What starts this function?A trigger
What data does the function read or write while it runs?An [[azure-functions-bindings

The trigger itself is technically a special input binding, but treating it as “the starting bell” is the clearest beginner model.

Common confusion

  • A trigger does not continuously run the function. It defines the conditions under which Azure invokes it.
  • Multiple services can be involved in one function, but only one trigger starts that function.
  • A timer is not a durable job-history system. Store business status separately when missed, repeated, or audited work matters.

azure-functions · azure-functions-bindings · event-grid · service-bus · queue-storage · northwind-traders-case-study

Sources and re-audit