Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions - output bindings justification

Can anyone tell me why I should use Azure Function output bindings (e.g. SendGrid or Twilio) rather than just using proper SDK (e.g. Sendgrid SDK) explicitly in my C# function to achieve my goal?

I suppose that using the output binding my code may be cleaner (no need to initialize Twilio client for example), but I still would rather use proper vendor SDK to get recent updates and features instantly.

Is there any other reason (performance?) to use output bindings?

like image 412
aswierczek Avatar asked Aug 29 '19 07:08

aswierczek


People also ask

What is output binding in Azure functions?

An input binding is the data that your function receives. An output binding is the data that your function sends. Unlike a trigger, a function can have multiple input and output bindings.

Can an Azure function have multiple output bindings?

Bindings are optional and a function might have one or multiple input and/or output bindings. Triggers and bindings let you avoid hardcoding access to other services. Your function receives data (for example, the content of a queue message) in function parameters.

Which of the following is an advantage of using bindings in your Azure functions to access data sources and data sinks?

Which of the following is an advantage of using bindings in your Azure Functions to access data sources and data sinks? They provide access to more data sources than are available using code.


1 Answers

It comes down to control vs convenience:

Use the output binding when you want the quickest solution with the least amount of code. The output bindings have been designed with the Azure functions runtime in mind, i.e. how it scales as load increases and how that impacts the service you are targeting.

Use a custom connection in code backed by keyvault (for API keys) when you want more granular control over the interaction, where you can fine tune connection settings and how the interaction happens but keep in mind you need to code your interaction in a way that works in synergy with how the functions runtime behaves.

like image 121
Murray Foxcroft Avatar answered Oct 19 '22 00:10

Murray Foxcroft