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; ...

Get Serverless computing in Azure with .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.