Asynchronuous Processing

Asynchronuous processing is a feature you might not use that often. Below link explains the concept: Link: Asynchronuous Programming. I needed the asynchronous call in an Azure function. I changed the signature of the Azure function to an asynchronuous method:

public static async Task Run(TimerInfo schedule, TraceWriter log)
instead of: public static void Run(TimerInfo schedule, TraceWriter log).

Next I changed the call to the logic app:
await Task.Run(() => client.PostAsync(logicAppUri, new StringContent(content, Encoding.UTF8, “application/json”)));
instead of: var response = client.PostAsync(logicAppUri, new StringContent(content, Encoding.UTF8, “application/json”)).Result;

Trace an async program

Leave a Reply

Your email address will not be published. Required fields are marked *