Domain 3 of 4 · Chapter 3 of 4

Build serverless APIs with Azure Functions triggers and bindings

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing Developing AI Cloud Solutions on Azure premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • One trigger, any number of bindings
  • How a binding declaration is written and resolved
  • Binding expressions: braces, percent signs, metadata
  • The HTTP trigger's request contract
  • The Timer trigger and NCRONTAB schedules
  • The Storage triggers and the poison path
  • Triggers that delegate reliability to their service
  • Input and output bindings at work
  • When a binding is the wrong tool

What starts one invocation, who retries it, and where a failure ends up

TriggerWhat starts one invocationWho retries a failureThe published failure path
HTTPOne HTTP request matching the route and methodNot the runtime; the trigger is absent from Microsoft's retry tableThe status code your code returns to the caller
TimerOne NCRONTAB (or TimeSpan) schedule occurrenceA function-level retry policy, if you add oneThe next scheduled occurrence
Queue StorageOne Storage queue messageThe binding extension, `maxDequeueCount` times (default 5)The `<queue-name>-poison` queue
Blob StorageOne new or updated blob in the watched containerThe binding extension, five tries by defaultThe `webjobs-blobtrigger-poison` queue
Service BusOne message from a queue or a subscriptionThe binding extension; Service Bus redelivers on abandonThe entity's dead-letter queue
Event GridOne delivered event (one invocation per array element)The binding extension, configured on the event subscriptionThe event subscription's dead-letter destination
Cosmos DBA batch of change-feed items from the monitored containerA function-level retry policy that the runtime enforcesThe retry policy's `max_retry_count`, then the exception

Decision tree

Started by an external caller?yesHTTP triggerroute template, methods, authLevelnoRuns on a clock, nothing to react to?yesTimer triggerNCRONTAB, one instance app-widenoA broker owns the work item?contract, orderingService Bus triggerruntime settles; Service Bus dead-letterssimple work itemsQueue Storage triggerpoison queue after 5 attemptsnoReacting to a resource change?resource eventsEvent Grid triggerone invocation per eventcontainer changesCosmos DB triggerchange feed; lease containerExactly one trigger per function: a second trigger means a second function

Cheat sheet

  • The HTTP trigger's authLevel (anonymous, function, admin) controls key requirements for a serverless API
  • HTTP triggers define a route template and allowed HTTP methods for the request
  • A function has exactly one trigger but may declare many input and output bindings
  • The Timer trigger runs on a fixed NCRONTAB schedule
  • Blob triggers can poll or use an Event Grid source; the Event Grid source is the low-latency option
  • The Service Bus and Event Grid triggers bind a function directly to a queue/subscription or event stream
  • The Cosmos DB trigger consumes the change feed and requires a lease container
  • Storage Queue trigger poison-message handling
  • Input bindings read data into the function; output bindings write data out — declaratively, no client SDK code
  • Bindings are declared with decorators (Python v2 model) or function.json, referencing a connection app setting
  • An output binding can be fed by the function's return value
  • Binding expressions inject trigger metadata ({queueTrigger}, {name}) and app settings (%setting%)
  • A Cosmos DB input binding fetches items by id/partition key or a SQL query
  • A blob binding path uses a container/{name} pattern to bind the specific blob

Unlock with Premium — includes all practice exams and the complete study guide.

References

  1. Triggers and Bindings in Azure Functions
  2. Python developer reference for Azure Functions
  3. Develop and run Azure Functions locally
  4. Azure Functions Binding Expressions and Patterns
  5. Azure Cosmos DB bindings for Functions
  6. Azure Tables output bindings for Azure Functions
  7. Routing in ASP.NET Core
  8. host.json reference for Azure Functions 2.x
  9. Azure Functions HTTP trigger
  10. Azure App Service FAQ - Availability, Performance, and Application Issues
  11. Azure Event Grid Delivery and Retry Explained
  12. Concepts (push delivery) in Event Grid basic
  13. Timer trigger for Azure Functions
  14. Azure Functions Flex Consumption plan hosting
  15. Azure Functions Consumption plan hosting (legacy)
  16. Azure built-in roles - Azure RBAC
  17. Azure Functions Error Handling and Retry Guidance
  18. Azure Storage Analytics logging
  19. Azure Service Bus trigger for Azure Functions
  20. Azure Service Bus Enable FIFO with Sessions
  21. Work with the Change Feed - Azure Cosmos DB
  22. Service Bus Dead-Letter Queues
  23. Azure Queue storage output binding for Azure Functions