I have an OrchestrationTrigger function that call another service by http request.
[FunctionName("MyFunc")]
public async Task RunOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context,
ILogger logger)
{
var req = new DurableHttpRequest(HttpMethod.Post, _uri, headers, jsonBody);
var res = await context.CallHttpAsync(req);
// Do something
}
but get the following error:
Multithreaded execution was detected. This can happen if the orchestrator function code awaits on a task that was not created by a DurableOrchestrationContext method. More details can be found in this article https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-checkpointing-and-replay#orchestrator-code-constraints.
the official documentation there suggest to use context.CallHttpAsync
- exactly what I've did.