Azure function output API call to 3rd party servic

2019-07-29 08:20发布

问题:

Hey all I'm still getting used to Azure functions a little bit and trying to figure out how we might apply them in our application. I've currently got a situation where I am using a Service Bus Queue Trigger function to activate whenever a message pops in the queue and I would then like to post a request to a 3rd party API when that message has been handled.

I understand that with Azure functions I can configure an output binding but is there anything already setup to execute a REST request on output? I'm currently assuming that we are going to have to include RestSharp and format the request ourselves within the function but is there an easier better way to do this?

回答1:

There is no HTTP output binding, which is what you are describing. Please take a look at the available output bindings: https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings

The way to accomplish a call to a third-party once your function is triggered, is exactly as you described it: Making an HTTP call yourself.

In fact, here is an answer to a similar question: https://stackoverflow.com/a/39187578/84395