In this example, F&O will directly call an Azure Function which can do some processing (usually integrating with other services).
1. Create a new Azure Function App in the Azure portal. Once created, add an Azure Function with an HTTP trigger.
(Psst: Application Insights should be deployed to enable logging for production and testing environments.)
2. Click on “Get Function URL” to get a URL you can call directly.
3. Create an Azure AD Application Registration to get an Application ID, Client ID, and Client Secret.
4. Create a new F&O project in Dev box.
5. Create a new C# class library in the same project.
6. Rename the class
7. Add “Microsoft.IdentityModel.Clients.ActiveDirectory” as a Nuget package reference.
Use the following code for the C# class to call an Azure Function GitHub Link
8.Add a reference to the C# project in your F&O project
9. Create an F&O class
10. Create a main method which will call the AzureFunctionHelper. This example code will call the Azure function which will say hello to me. GitHub link
Thanks to Martin Dráb’s post on calling async .NET methods for the work around to use ‘var’ as the type for Task<>. Check it out as he makes some very important points on how to properly handle asynchronous execution.
Make the class the start up object, click Run