I have some code which takes some incoming JSON, deserializes it and then simple stores it in a database
+----+---------------+
| Id | Json |
+----+---------------+
| 1 | { json here } |
+----+---------------+
| 2 | {more json } |
+----+---------------+
[FunctionName("PostJson")]
public async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = null)]
HttpRequest req,
ILogger log)
{
var content = await new StreamReader(req.Body).ReadToEndAsync();
try { //deserialize and save to DB }
catch (Exception e){ //log errors }
return new OkObjectResult("Ok");
}
Once this has returned.. How can I say "Ok this function has saved to DB, now take this content row that was just imported and call my "ProcessJson" function
i.e. I understand it would be another HTTP request? But at what point do i call the "Process Json" function and parse through that same content that was saved to the DB. The reason I want two processes is because the initial call to "PostJson" will then be faster for the "front end" side of things and then the large processing of data will all be server sided and wont intrude.