Let's take a look at the following steps to update the function code:
- Using Solution Explorer, open ScoreText.cs.
- Remove processing the parameters from the body, and add an output of a text sentiment score between 0 and 1, which is generated by using the C# Random function, as shown in the following code sample:
using System; namespace TextEvaluation { public static class ScoreText { [FunctionName("ScoreText")] public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log) { // parse query parameter string name = req.GetQueryNameValuePairs() .FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0) .Value; ...