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 ScoreTweet function

Now we can leverage the shared code in the ScoreTweet function.

We will add the new outputTable parameter to the function's signature, and use the shared StoreOutputSQL method to store the new entities. Using JObject will allow us to define the new entity we need to store during runtime. We will pass TweetText as a nameProperty parameter, so that tweets with the same tweet text won't be stored twice.

Note that we do not need to add any settings in the local.settings.json file, since the TweetTextScore table is in the same Azure SQL database we are already referencing in the project.

The full updated code for the ScoreTweet function will look like the following:

        using System.Net.Http; using Microsoft.Azure.WebJobs; ...
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