-
Notifications
You must be signed in to change notification settings - Fork 441
Trigger Binding Data
The various trigger bindings make many useful metadata values available as part of the binding process. Since Azure Functions is built on the WebJobs SDK the same set of metadata properties made available by the SDK are available in functions. See the WebJobs SDK documentation here for the list of properties supported per binding.
For C# functions, the above linked documentation and examples are the same. However for other languages like Node.js, these values are made available to your function in different ways. For example, for Node.js functions, you can access these via context.bindingData
. Here is an example EventHub function binding to multiple events and accessing the metadata arrays for each:
module.exports = function (context, events) {
for (i = 0; i < events.length; i++)
{
// EventData properties can be accessed via binding data,
// including custom properties, system properties, etc.
var bindingData = context.bindingData,
eventProperties = bindingData.propertiesArray[i],
systemProperties = bindingData.systemPropertiesArray[i],
id = input[i].value;
context.log('EventId: %s, EnqueuedTime: %s, Sequence: %d, Index: %s',
id,
bindingData.enqueuedTimeUtcArray[i],
bindingData.sequenceNumberArray[i],
eventProperties.testIndex);
}
context.done();
}
Here's an example queue triggered function:
module.exports = function (context, message) {
context.log('Node.js queue trigger function processed message', message);
context.log('DequeueCount=%s', context.bindingData.dequeueCount);
context.log('InsertionTime=%s', context.bindingData.insertionTime);
context.done();
}
- Configuration Settings
- function.json
- host.json
- host.json (v2)
- Http Functions
- Function Runtime Versioning
- Official Functions developers guide
- Host Health Monitor
- Managing Connections
- Renaming a Function
- Retrieving information about the currently running function
- Site Extension Resolution
- Linux Consumption Regions
- Using LinuxFxVersion for Linux Function apps
- Out-of-proc Cancellation Tokens
- Assembly Resolution in Azure Functions
- ILogger
- Precompiled functions
- Official Functions C# developer reference
- Contributor Onboarding
- Development Process
- Deploying the Functions runtime as a private site extension
- Authoring & Testing Language Extensions
- Bindings in out-of-proc
- Language Extensibility
- Worker Capabilities
- Investigating and reporting issues with timer triggered functions not firing
- Sharing Your Function App name privately
- Azure Functions CLI release notes [moved here]
- Function App Zipped Deployment [deprecated]