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

Modifying the function to store results in SQL

Now that we've added the connection string, the binding, and the dependency to the function configuration, it is time to make changes to the function code by executing the following steps:

  1. First, right-click on TextEvaluation -> Add -> Class, and add a TextScore.cs class with the following code:
        public class TextScore        {             public string DocumentName { get; set; }             public double TextSentimentScore { get; set; }         }
  1. Now we can add the code to store the new score in the database after it has been generated by calling the CreateEntityAsync(entity) method on the outputTable parameter:
        // Generate random text score between 0 and 1          var score = new Random().NextDouble(); var textScore = new TextScore() ...
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