Skip to content

Instantly share code, notes, and snippets.

@jesspanni
Last active Sep 17, 2019
Embed
What would you like to do?
[FunctionName("AsyncHttpFunction")]
public static async Task<IActionResult> RunAsync(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,
[OrchestrationClient​] IDurableOrchestrationClient starter,
ILogger log)
{
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
string instanceId = await starter.StartNewAsync("Orchestration", (int)(data.secondsToWait ?? 60)).ConfigureAwait(false);
return starter.CreateCheckStatusResponse(req, instanceId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment