Home > Net >  Custom Triggers and Bindings for Azure Function
Custom Triggers and Bindings for Azure Function

Time:05-21

We would like our Azure function to use Custom Trigger binding so if we want to change from Service Bus Trigger to HttpTrigger than we should be able to do it easily with some configuration / app settings change rather than a code change. Is there a way that we can write a custom trigger class implementation. We are currently using .Net core 3.1.

CodePudding user response:

Yes, this is possible by implementing ITriggerBinding, but with some serious disadvantages: there is no support for custom activation / scaling logic when running on a consumption plan. (source). There are some ideas about how support for custom triggers could be added that would run in the Functions Premium plan. The reason it would depend on the premium plan is that there is always at least one VM assigned to the plan, and it could run your activation/scaling logic. (source).

If you still want to go ahead, here is a blogpost outlining the steps involved. It is rather dated so you might need to change some things here and there.

  • Related