Skip to content

Instantly share code, notes, and snippets.

@jesspanni
Last active September 17, 2019 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesspanni/f34f86cea29155d3c366de45c998d51f to your computer and use it in GitHub Desktop.
Save jesspanni/f34f86cea29155d3c366de45c998d51f to your computer and use it in GitHub Desktop.
[FunctionName("AsyncHttpFunction")]
public static async Task<IActionResult> RunAsync(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,
[Orchestration​Client​] 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