Calling Azure Function from Code

Jim Culverwell picture Jim Culverwell · Aug 8, 2017 · Viewed 10.9k times · Source

I'm using the Azure Function Tools for Visual Studio 2017 15.3.

I am trying to move my application to ASP.Net Core 2.0 and have some code which uses system.drawing which will not port. My intention is to move some of the code which will not port into Azure Functions (running on .Net 4.6) and then call these functions from my ASP.Net Core 2.0 application.

I was hoping to get some advice on the best way to call Azure functions from my ASP.Net Core 2.0 code. The first thing that springs to mind is using something like RestSharp but I was wondering if there is any other tooling I should consider using?

Answer

Alexey Rodionov picture Alexey Rodionov · Aug 8, 2017

You do not need to use third party libs. Easiest way just use http call: HttpTrigger + HttpOutput https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook

Probably you want to use other outputs types depending of your app logic, for example: HttpTrigger trigger + Service Bus Queue