I\'m trying to do a simple Azure Function to learn about it. There will be 3 functions:
If you are using System.Text.Json
, you can read the POST data in one line:
public static async Task Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = null)]
HttpRequest req,
ILogger log)
{
MyClass myClass = await JsonSerializer.DeserializeAsync(req.Body);
}
If you are using Newtonsoft.Json
, see the answer by Allen Zhang.