How do I implement a custom binding for Azure Func

2019-06-22 13:17发布

问题:

Azure Functions come with a fixed set of pre-existing bindings.

At the same time, Azure Functions are based on Web Jobs SDK, which have some extensibility story. It enables creating custom binding types, including custom triggers.

Is it possible to run those custom bindings in Azure Function runtime? If yes, is there a tutorial or documentation on how to do that? If no, any plans to?

Some sample usage scenario would be integrating to non-Azure products (e.g. Kafka) or custom in-house protocols.

回答1:

Custom input and output bindings are now fully supported. More information can be found on the Azure WebJobs wiki: https://github.com/Azure/azure-webjobs-sdk/wiki/Creating-custom-input-and-output-bindings

This wiki describes how to define a custom binding extension for the WebJobs SDK. These same extensions can be used, without modification, in Azure Functions.

A sample binding which writes to a Slack channel be found here: https://github.com/lindydonna/SlackOutputBinding



回答2:

We have a preview of 'Bring Your Own Binding' feature'. See Extensibility for more details on the feature and WebJobsExtensionSamples for sample and docs. Also, you can track the feature here