OMS Data Collector API and Twitter Sentiment Demo (Part 2)

This blog was written into 2 parts. You can find Part 1 – Create OMS Data Collector Azure App API here.

Part 2 – Create Logic App

Now that we have our API which takes your values from tweets and our sentiment and inserts them into OMS, we have to get the data for it.

I found the simplest way is to do this is via a Logic App.

In the Azure Portal go New > Logic App > Create


I’m naming my Logic App “Twitter-OMS-Blog”, in my existing resource group called “OMS-twitter”, located in Australia. capture20161108100855841

Once it’s finished deployed, navigate to the Logic App and choose “Blank Logic App” under templates: capture20161108101146550

Our trigger will be Twitter, search and select it: capture20161108101240393

Configure your connection with your twitter account details, and select your search criteria: capture20161108101348027

Add a new step, and click on “Add Action”: capture20161108101440662

Choose the HTTP action, then rename it to “get-twitter-sentiment”. Configure with “POST” Method, using the Uri for the Text Cognitive Services API, your Subscription Key in the headers, and the body as pictured below: (Please note, that Logic App now has a the Cognitive Text Service as an option, you can choose that if instead.) capture20161108102313294

Add a third Action step, and select HTTP again. Rename it to OMS-API, set the method to “POST”, configure the Uri of your API app (if you’re unsure of the path, you can use the swagger tool again to find it “<URL>” ).  Configure headers and body as pictured below:


Save it, and you're all done!!

Verify you can now see your tweets in OMS: