Hello,
We are calling Azure Durable function from Azure Logic App - from Http Webhook action and we have noticed that the Webhook action is notified the status from Durable function such as – Running , Succeeded etc which is originally from Orchestrator function but we are unable to get the actual data which we are posting back to the Webhook URL.
The Azure function(FormatScanOrchestrator_HttpStart) is called from Logic app - Http Webhook action is based on HttpTrigger and which internally call Azure Orchestrator function(FormatScanOrchestrator) and the Orchestartor function is executing a FormatScan function - which is a long running function – unzip large datasets of 20GB size from Azure storage and scan all file formats. The durable function is running for a long duration and returning data – which can be seen from Monitor and logs but it is failing to post data back to the web hook url .
We are using the following code to POST the data to Webhook url and there are no exception or error in logs but we are unable to post the data to Logic app action.
I am requesting for any advice or guidance on how we can get the data back to the web hook URL?
Please find the logic app HttpWebhook action details as below
The following attached is the high level code of Azure Durable functions
[FunctionName("FormatScanOrchestrator_HttpStart")]
public static async Task<HttpResponseMessage> HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post"),] HttpRequestMessage req,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
string instanceId = await starter.StartNewAsync("FormatScanOrchestrator", null, jsonContent);
HttpClient client = new HttpClient();
var status = await starter.GetStatusAsync(instanceId);
if (status.RuntimeStatus.ToString() == "Completed")
{
await client.PostAsync(callBackUrl.ToString(),
status.output, new JsonMediaTypeFormatter(), "application/json");
}
}
return await starter.WaitForCompletionOrCreateCheckStatusResponseAsync(req, instanceId);
}
[FunctionName("FormatScanOrchestrator")]
public static async Task<ObjectResult> RunOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
string input = context.GetInput<string>();
return await context.CallActivityAsync<ObjectResult>(nameof(FormatScan), input);
}
[FunctionName(nameof(FormatScan))]
public static async Task<ObjectResult> FormatScan([ActivityTrigger] string jsonInput, ILogger log)
{
if (!isContentNonWhiteListed)
{
return new OkObjectResult(files);
}
return new ObjectResult("nonwhitelistformatfound");
}
await client.PostAsync(callBackUrl.ToString(),
status.output, new JsonMediaTypeFormatter(), "application/json");