@Anisha Joseph Thank you for reaching out to Microsoft Q&A.
You can refer to this documentation on how to create and run automated event based workflows using HTTP webhooks in logic apps.
To test this behavior, we have created standard logic app workflow (using HTTP request trigger, HTTP webhook action) and function app (with HTTP trigger).
Whenever the Logic app got fired, HTTP Webhook
, make a request to function app and function app will generate the callbackurl.
Using another Http Client method, we will perform a post
request to the generated callback Uri to complete the webhook action.
Here is the function app code that we have used for testing:
#r "Newtonsoft.Json"
using System.Net;
using System.Threading;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
HttpClient newClient = new HttpClient();
HttpRequestMessage newRequest = new HttpRequestMessage(HttpMethod.Post,requestBody );
HttpResponseMessage response = await newClient.SendAsync(newRequest);
Thread.Sleep(10000);
log.LogInformation(requestBody);
return new OkObjectResult(requestBody);
}
Here is the sample output for your reference:
Feel free to reach back to me if you have any further questions on this.