Skip to content
Published 25 May 2019

Hello everyone, in this post we will see how to use Azure Logic App to analyze tweet sentiment and notify an administrator on positive or negative sentiment predicted. Azure Logic App is the one among four technologies on Azure that you can use to implement workflows that integrate multiple systems and it is also a design-first technology. Let see how to do this.

What we want to do here is on every post on a tweeter account Logic App with looking for #BakeCooker, get this tweet, analyze his content, predict sentiment and if is greather than 0.5 send a mail as “You received a positive sentiment” or if less than 0.5 send mail as “You received a negative sentiment”.

Place to the Demo !

First you must have an Azure Subscription to create Azure Logic Apps, Azure Text Analytics resources, you can create a free account here

First create Azure Logic App resource, like this and use any information you want, you don’t have to do all like me.

After, when you Go to the logic app resource you will see the Logic App Designer in Start with a common trigger section select When a new tweet is posted, you will use a tweeter account that will be used by Logic App. You will have something like this :

Click on continue and specify different informations in the twitter component.

You see date in the Search Text field i have specified #BakeCooker, and Logic App will verify tweets every 2 minutes. Tweet captured we must add Azure Text Analytics,unfortunately i will don’t show you how to create it here, Click on New Step and search “Azure Text Analytics” and choose “Detect Sentiment”.

Next, you must specify all connection informations related to your Text Analytics resource. When it is done ! Click on Add new parameter and select Text,click in the text field and select “Tweet Text”

Click on + New step again and search “Condition” and in the value field choose Score from Text Analytics, add this condition (if Score is greater than 0.5).

And in the If true section click on Add Action and looking for Office 365 Outlook – Send mail

Register your Office 365 Outlook mail and after that fill all required fields about the destination mail.

Do the same in the if false section but now in the Send Mail – Body write “BakeCooker receive a negative feedback from : Twitter (Name)”

Finally in your Azure Logic App Designer you must have something like this. Save and click on Run button in the top part of the Designer.

After running post a tweet just for the test like #BakeCooker I really like this bread

You will receive a mail, sended by your Azure Logic App, and all work so fine ! Thanks and to the next post !

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *