When moving between Azure Functions and AWS Lambda, one difference quickly stands out:
- An individual Azure function must have exactly one trigger.
- An AWS Lambda function can have multiple triggers.
At first glance, Lambda appears more flexible. But what does this difference actually mean for code reuse, event handling, and application design?
Let’s explore it using a practical example.
First, distinguish a function from a Function App
In Azure, a function and a Function App are different things.
A function is an individual entry point with its own trigger. A Function App is the Azure resource that hosts one or more functions.
Therefore:
The one-trigger rule applies to each Azure function—not to the entire Function App.
A single Function App can contain HTTP-triggered, queue-triggered, and timer-triggered functions.
Microsoft’s triggers and bindings documentation explicitly states that a function must have exactly one trigger.
A Lambda function can have multiple triggers, each invoking it independently. It can also be deployed without any configured triggers and tested directly using a test event in the AWS Lambda console.
The scenario: one business operation, multiple entry points
Suppose an application processes orders through three channels:
- An HTTP request submits an order.
- A queue delivers an order for background processing.
- A scheduled job starts an order-reconciliation run.
These entry points may reuse some of the same business logic, even though their payloads and execution requirements differ.
AWS Lambda: multiple sources, one handler
A possible AWS design is:
The same Lambda function can be invoked through all three integrations.
However, multiple triggers do not mean one invocation combines events from multiple sources. Each source invokes the function independently.
The handler must understand the event it receives and apply the appropriate behavior.
For example:
- API Gateway supplies an HTTP-oriented event.
- SQS supplies a batch-oriented message event.
- A scheduled invocation supplies its configured payload.
If those payloads differ, the handler needs routing and normalization logic. Integrations that support payload transformation can sometimes reduce that work.
There is also an important terminology distinction: not every Lambda integration uses the same mechanism. SQS uses a Lambda event source mapping, which polls the queue and invokes the function with batches.
Azure Functions: separate entry points, shared business logic
An equivalent Azure design could be:
Each function has one trigger, but all three can call the same application service.
The important separation is:
Multiple function entry points do not require multiple implementations of the business logic.
The HTTP function handles HTTP concerns. The queue function handles message-processing concerns. The timer function handles scheduled execution. Shared order-processing logic remains in one place.
What actually changes?
| Concern | Multiple triggers on one Lambda | Multiple Azure functions sharing logic |
|---|---|---|
| Entry point | One configured handler receives events from multiple sources | Separate function entry points |
| Event interpretation | Handler must support the incoming event contracts | Each entry point handles its trigger-specific contract |
| Code reuse | Shared logic behind the handler | Shared logic called by multiple functions |
| Source-specific responses | Handler must return the appropriate response for each integration | Each function implements its own trigger contract |
| Deployment | One Lambda function deployment in this design | Functions can be deployed together in one Function App |
| Isolation | Sources share the target function’s configuration and concurrency constraints | Separate functions in one app still share app-level settings and resources |
Final takeaway
AWS Lambda allows several event sources to invoke one function. Azure Functions requires exactly one trigger per function, while allowing multiple functions within a Function App.
The most useful comparison is not:
“Which platform lets me attach more triggers?”
It is:
“Where should event-specific handling end, and shared business logic begin?”
Both platforms support reusable business logic. Their trigger models give you different ways to organize the entry points around it.