Skip to Content
Serverless computing in Azure with .NET
book

Serverless computing in Azure with .NET

by Sasha Rosenbaum
August 2017
Intermediate to advanced
468 pages
12h 5m
English
Packt Publishing
Content preview from Serverless computing in Azure with .NET

Updating the function code

Let's take a look at the following steps to update the function code:

  1. Using Solution Explorer, open ScoreText.cs.
  2. 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; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni
Implementing Azure: Putting Modern DevOps to Use

Implementing Azure: Putting Modern DevOps to Use

Florian Klaffenbach, Oliver Michalski, Markus Klein, Mohamed Wali

Publisher Resources

ISBN: 9781787288393Supplemental Content