• Guides
  • Api Reference
  • FAQ
  • Guides
  • Cross Cutting Concerns
  • Trigger Contexts
Show / Hide Table of Contents
  • Overview
    • Introduction
    • Getting Started
    • Philosophy
    • FAQ
    • Upgrading to 1.0
  • Triggers
    • HTTP Triggers
      • Overview
      • Routing
      • Responses
      • Authorization
      • Claims Mapping
      • Headers
      • Swagger / OpenAPI
    • Service Bus Triggers
      • Queues
      • Topic and Subscriptions
      • Message Properties
      • Message Sessions
    • Cosmos DB
      • Overview
      • Error Handling
    • SignalR
    • Timer Triggers
    • Azure Storage Triggers
      • Queues
      • Blobs
    • Event Hub Triggers
  • Output Bindings
  • Cross Cutting Concerns
    • Connection Strings
    • IoC Containers
    • Logging
    • Trigger Contexts
    • Validation
    • Serialization
    • Suggested Solution Structure
  • Contributing
    • Compiling
    • Debugging

Trigger Contexts

In addition to the input payload Azure Functions also have access to other contextual information depending on their trigger type - for example Azure Storage Queue triggers have access to the expiration date of the message, the dequeue count, and more.

Function Monkey makes these available to command handlers via the injectable IContextProvider interface.

The ExecutionContext property is available for all trigger types and exposes the WebJobs.ExecutionContext information: for example the (very useful!) invocation ID.

Depending on the trigger type the following other context properties are also available:

Context Availability
ServiceBusContext Available for service bus queue and topic / subscription functions
StorageQueueContext Available for Azure Storage queue functions
BlobContext Available for Azure Storage blob trigger functions
EventHubContext Available for Azure Event Hub trigger functions
HttpContext Available for HTTP triggers and provides access to the headers and request URL

Note that one of the advantages of the mediator pattern that underpins Function Monkey is the clean separation of concerns including application logic from host / protocol but by making use of these contexts that decouplign is weakened. An alternative approach can be to handle these things in a decorated mediator.

For further details see the API Guide.

  • Improve this Doc
  • 0 Comments
Back to top Copyright © 2018 James Randall