<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Anindita’s Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/anindita9/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/anindita9/feed.xml</link>
    <description>It&amp;#039;s All About Cloud – Big Data, Machine Learning ,Microsoft Azure with Analytics</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:15:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Securing Azure HDInsight with Apache Ranger &amp; Azure Active Directory Domain-joined Clustering</title>
      <link>https://docs.microsoft.com/archive/blogs/anindita9/securing-azure-hdinsight-with-apache-ranger-azure-active-directory-domain-joined-clustering</link>
      <pubDate>Sun, 25 Dec 2016 17:58:08 GMT</pubDate>
      <dc:creator><![CDATA[Anindita-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anindita9/?p=316</guid>
      <description><![CDATA[Enterprise Security layers in Hadoop consists of four pillars on Azure -

 	Perimeter Security...]]></description>
      <content:encoded><![CDATA[Enterprise Security layers in Hadoop consists of four pillars on Azure -
<ul>
 	<li>Perimeter Security</li>
 	<li>Authentication</li>
 	<li>Authorization</li>
 	<li>Auditing</li>
 	<li>Data with Encryption</li>
</ul>
<img width="814" height="280" class="aligncenter size-full wp-image-445" alt="enterprisesecurity" src="https://msdnshared.blob.core.windows.net/media/2016/12/EnterpriseSecurity.jpg" />

Recently, there has been announced the availability of <strong>Azure HDInsight Premium</strong> clusters which contains the features of
<ul>
 	<li>Apache Ranger</li>
 	<li>domain-joining</li>
 	<li>Secure Shell(SSH) access</li>
 	<li>HDInsight Applications</li>
 	<li>Custom VNET</li>
 	<li>Custom Hive Metastore</li>
 	<li>Custom Oozie metastore</li>
 	<li>Azure Data Lake Store access.</li>
</ul>
Currently(as of writing this blog), Azure HDInsight Premium clusters are available for '<strong>Hadoop</strong>' type clusters only &amp; with the version of <strong>'Hadoop 2.7.3(HDI 3.5)</strong>' &amp; Linux type OS. If the 'Premium' HDI cluster provisioning facility is not available in your subscription, please write to <a href="mailto:hdipreview@microsoft.com">HDInsight Team</a> to allow your subscription for accessing preview/upcoming production level features of HDInsight.

&nbsp;

<img width="878" height="892" class="aligncenter size-full wp-image-345" alt="premiumhdi-cluster" src="https://msdnshared.blob.core.windows.net/media/2016/12/PremiumHDI-Cluster.jpg" />

The domain-joined HDI cluster needs to be associated with custom Azure VNET &amp; subnet which further needs to be configured with <strong>Azure AD domain controller name, username, password, Organizational Unit(OU), LDAPS URL, access user group.</strong>

For domain-joined HDInsight cluster provisioning steps, refer to <a href="https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-domain-joined-configure">this</a> article. The solution architecture diagram for configuration of domain-joined HDI cluster is as followed:

<img width="1127" height="587" class="aligncenter size-full wp-image-355" alt="domainarch" src="https://msdnshared.blob.core.windows.net/media/2016/12/domainarch.jpg" />

During provisioning the domain-joined cluster, the Azure AD cluster identity can be configured as well by which data from Azure Data Store storage (ADLS) can be accessed from HDI cluster &amp; analysed with Hadoop eco-system tools.

In this demo, for domain-joined HDI clusters configuration &amp; securing with Apache Ranger, The cluster is domain-joined with an <strong>Azure VM with domain-controller(DC)</strong> configured along with <strong>Reverse DNS entry port(lookup zone)</strong> configuration for secure Kerberos authentication purpose. Please make sure to use <strong>domain SSL certificates</strong> for production level domain-joined HDI cluster provisioning.

Once, the domain-joined HDI cluster is provisioned successfully, you may see the following resources in your azure template.

&nbsp;

<img width="973" height="795" class="aligncenter size-full wp-image-365" alt="domain" src="https://msdnshared.blob.core.windows.net/media/2016/12/domain.jpg" />

Under properties tab of the new provisioned domain-joined HDI cluster, select ' <strong>Domain Configuration'</strong> to start accessing Apache Ranger portal for secure authentication, authorization purpose in HDI cluster.

<img width="844" height="644" class="aligncenter size-full wp-image-375" alt="ranger" src="https://msdnshared.blob.core.windows.net/media/2016/12/Ranger.jpg" />

&nbsp;
<blockquote>Click on '<strong>Ranger</strong>' tab on above of 'Directory type' &amp; provide only your Azure AD admin credentials (neither the credentials of your HDInsight cluster nor the SSH credentials of the Linux type HDI node). You may also alternatively access it through this url : <strong>https://&lt;yourdomain-joinedhdiclustername&gt;.azurehdinsight.net:6080</strong>

<img width="1177" height="813" class="aligncenter size-full wp-image-405" alt="rangerauthcred" src="https://msdnshared.blob.core.windows.net/media/2016/12/RangerAuthCred.jpg" /></blockquote>
Apache Ranger provides comprehensive security to deliver monitor, manage data security to Hadoop clusters. It provides a centralized platform define, administer &amp; manage security policies in Hadoop. On opening Ranger portal, click on 'Hive' to configure Hive metastore &amp; tables security policies.

<img width="1866" height="424" class="aligncenter size-full wp-image-326" alt="rangerpolicies" src="https://msdnshared.blob.core.windows.net/media/2016/12/RangerPolicies.jpg" />

&nbsp;

Here, for domain-joined HDI clustering, I've configured two Azure AD groups , one of them is called 'HiveUsers' which has two different users('HiveUser1' &amp; 'HiveUser2') (synonyms to 'Alice' &amp; 'Bob' for Kerberos authentication platform) to configure different level of data access &amp; security level policies for Hive tables data. For example, 'HiveUser1' has access to full schemas of default Hive sampletable metastore data whereas the 'HiveUser2' has only 'Read' access to two difference data schemas of default metastore.

<img width="1847" height="822" class="aligncenter size-full wp-image-336" alt="rangerdomain" src="https://msdnshared.blob.core.windows.net/media/2016/12/RangerDomain.jpg" />

&nbsp;

<strong>Hive ODBC DSN Access for configuring BI Dashboards in Excel &amp; PowerBI :</strong> For system DSN accessing too, the Hive ODBC driver needs to be installed based on your OS(x64/x86) &amp; HDI cluster details needs to be configured &amp; under credentials the Azure AD domain controller admin user credentials need to be provided(neither domain-joined HDI clusters user credentials nor cluster SSH credentials).

<img width="504" height="765" class="aligncenter size-full wp-image-395" alt="systemdsn" src="https://msdnshared.blob.core.windows.net/media/2016/12/systemDSN.jpg" />

&nbsp;

Now, on PowerBI Desktop to build a BI dashboard taking data from 'HiveSampleTable' of domain-joined HDI clusters as HiveUser2 , the difference in range of data accessing capability can be verified. If we try to access the whole hive tables schemas as 'HiveUser2', it would throw an exception whereas only HiveUser1 would be having access to all default metastore data schemas.

&nbsp;

<img width="1239" height="887" class="aligncenter size-full wp-image-435" alt="systemuser" src="https://msdnshared.blob.core.windows.net/media/2016/12/Systemuser.jpg" />

More details on configuring &amp; securing Hive policies through Apache Ranger in Azure HDInsight can be found in <a href="https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-domain-joined-run-hive">this </a>MSDN blog.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Connecting Azure Data Lake Analytics/Storage with Azure HDInsight Clusters</title>
      <link>https://docs.microsoft.com/archive/blogs/anindita9/connecting-azure-data-lake-analyticsstorage-with-azure-hdinsight-clusters</link>
      <pubDate>Sun, 06 Nov 2016 15:27:20 GMT</pubDate>
      <dc:creator><![CDATA[Anindita-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anindita9/?p=275</guid>
      <description><![CDATA[Recently, it has been announced the security enhancements of Azure HDInsight of securing access to...]]></description>
      <content:encoded><![CDATA[Recently, it has been announced the security enhancements of Azure HDInsight of securing access to Azure Data Lake store(ADLS)/ADLA(Azure Data Lake Analytics). This options allows to data access &amp; processing data from Azure Data Lake Analytics job to Hadoop batch processing.

In this Team Data Science process sample, where we've analyzed around 20 GB of data of NYC taxi trip using Azure Data Lake Analytics job , processed with ADLS (data lake store) &amp; managing output through HDInsight hive acitivity before building multicase classification algorithm using Azure Machine Learning.

More details on provisioning secure Azure HDInsight cluster with Azure Data Lake can be found in <a href="https://azure.microsoft.com/en-us/documentation/articles/data-lake-store-hdinsight-hadoop-use-portal/">this blog</a>.

The ADLA job after processing looks like this.

<img width="1228" height="918" class="aligncenter size-full wp-image-285" alt="adla_job" src="https://msdnshared.blob.core.windows.net/media/2016/11/ADLA_job.jpg" />

The output of the job is stored in Azure Data Lake store which is further processed by Hive activity in HDInsight. While provisioning the Azure HDInsight, we need to make sure to enable 'Cluster AAD identity' using ADLS account details.

<img width="1561" height="902" class="aligncenter size-full wp-image-295" alt="adls-identityjpg" src="https://msdnshared.blob.core.windows.net/media/2016/11/ADLS-IdentityJPG.jpg" />

&nbsp;

On configuring 'Cluster AAD identity', you need to provide ADLS access details while provisioning the HDInsight cluster like as the following screenshot along with AD service principal details.

&nbsp;

<img width="1782" height="880" class="aligncenter size-full wp-image-296" alt="provision_hdi" src="https://msdnshared.blob.core.windows.net/media/2016/11/Provision_HDI.jpg" />

&nbsp;

Once the external hive table is created with the underlying data from Azure Data Lake storage on NYC Taxi trip &amp; fare dataset, we 've created Azure ML models with classification, multiclass classification &amp; regression algorithms.

&nbsp;

<img width="1334" height="939" class="aligncenter size-full wp-image-305" alt="hive" src="https://msdnshared.blob.core.windows.net/media/2016/11/Hive.jpg" />

&nbsp;

&nbsp;

Final AML dashboard for NYC Taxi trip computation of Tip calculation looks like as this.

<img width="1461" height="941" class="aligncenter size-full wp-image-315" alt="nyctaxi_trip" src="https://msdnshared.blob.core.windows.net/media/2016/11/NYCTaxi_Trip.jpg" />

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Step by Step approach to Copy data from Azure Data Lake to Azure SQL data warehouse using Azure Data Factory</title>
      <link>https://docs.microsoft.com/archive/blogs/anindita9/step-by-step-approach-to-copy-data-from-azure-data-lake-to-azure-sql-data-warehouse-using-azure-data-factory</link>
      <pubDate>Sat, 01 Oct 2016 14:32:22 GMT</pubDate>
      <dc:creator><![CDATA[Anindita-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anindita9/?p=135</guid>
      <description><![CDATA[Azure Data Factory is the data orchestration tool which helps to transfer data to &amp; from Azure...]]></description>
      <content:encoded><![CDATA[Azure Data Factory is the data orchestration tool which helps to transfer data to &amp; from Azure Data Lake, HDInsight, Azure SQL Database, Azure ML(Cognitive Services) , Azure Blob Storage etc. Here in this demo, we'll be demonstrating how to transfer data from Azure Data Lake to Azure SQL Data Warehouse database.

First, create an azure data factory from azure preview portal providing resource group name &amp; location.

&nbsp;

<img width="1049" height="902" class="aligncenter wp-image-145 size-full" alt="newADF" src="https://msdnshared.blob.core.windows.net/media/2016/09/newADF.jpg" />

&nbsp;

Once it's created, under Settings , select <strong>'Copy Data(Preview)</strong>' to start transferring data from Azure Data Lake to Azure SQL data warehouse.

<img width="580" height="653" class="aligncenter size-full wp-image-155" alt="CopyData" src="https://msdnshared.blob.core.windows.net/media/2016/09/CopyData.jpg" />Next, Start creation of the ADF pipeline to transfer data from Azure Data Lake 'Weblog' data sources to Azure SQL Data warehouse database. You can create a SQL data warehouse database in Azure in Azure Preview Portal from <strong>'New' -&gt; 'Databases' -&gt; Azure SQL Data Warehouse</strong> as per as the screenshot.

&nbsp;

<img width="583" height="911" class="aligncenter size-full wp-image-175" alt="SQLDW" src="https://msdnshared.blob.core.windows.net/media/2016/10/SQLDW.jpg" />

Click on 'Copy Data' activity of Azure Data Factory start transferring data &amp; create pipeline. provide the Task schedule of the transfer activities (min 15 minutes).

<img width="1001" height="915" class="aligncenter size-full wp-image-195" alt="SourceCopy" src="https://msdnshared.blob.core.windows.net/media/2016/10/SourceCopy.jpg" />You can transfer from Azure Blob Storage, Azure Data Lake, Table Storage, On-premise hadoop cluster, Azure SQL/on-prem SQL database, MySQL, Cassandra, Salesforce, DB2, Amazon S3 etc.

Select Azure Data Lake to start transferring data.

<img width="1902" height="899" class="aligncenter size-full wp-image-185" alt="SourceData" src="https://msdnshared.blob.core.windows.net/media/2016/10/SourceData.jpg" />

&nbsp;

Provide the source data copy connection details &amp; elect data sources from Azure Data Lake. Check the file format settings &amp; click on 'Next' to choose destination.

<img width="1851" height="904" class="aligncenter size-full wp-image-205" alt="AzureSQLDW" src="https://msdnshared.blob.core.windows.net/media/2016/10/AzureSQLDW.jpg" />

&nbsp;

Provide Azure Data Lake Database credentials &amp; database name to start transferring data to Azure SQL data warehouse.

<img width="978" height="905" class="aligncenter size-full wp-image-215" alt="DestinationSQLDW" src="https://msdnshared.blob.core.windows.net/media/2016/10/DestinationSQLDW.jpg" />

Map the table where you would want to transfer data with columns /Schema mapping.

&nbsp;

<img width="1881" height="773" class="aligncenter size-full wp-image-225" alt="SchemaMapping" src="https://msdnshared.blob.core.windows.net/media/2016/10/SchemaMapping.jpg" />

&nbsp;

Finally in the Performance setting page, you may provide Polybase settings, azure storage account details &amp; final parallel copy settings as 'Auto'.

<img width="807" height="679" class="aligncenter size-full wp-image-235" alt="Performance" src="https://msdnshared.blob.core.windows.net/media/2016/10/Performance.jpg" />

Then on 'Summary' page, click on 'Authorize' to authorize the transaction of data from ADL to Azure SQL data warehouse database &amp; finally click on 'Finish' to start Copy activity of data.

<img width="1189" height="909" class="aligncenter size-full wp-image-245" alt="CopyActivity" src="https://msdnshared.blob.core.windows.net/media/2016/10/CopyActivity.jpg" />

Once the deployment is completed, you can see the whole pipeline to copy data activity in ADF pipeline.

<img width="1154" height="533" class="aligncenter size-full wp-image-246" alt="Deployment" src="https://msdnshared.blob.core.windows.net/media/2016/10/Deployment.jpg" />Click on <strong>'Click here to monitor copy pipeline'</strong>  to check the Activities details.

<img width="1660" height="797" class="aligncenter size-full wp-image-255" alt="ADFActivity" src="https://msdnshared.blob.core.windows.net/media/2016/10/ADFActivity.jpg" />

Once the Copy Activity is in progress, you can check the SQL data warehouse table with 'SELECT' command of transferred data from Azure Data Lake data source.

<img width="1477" height="565" class="aligncenter size-full wp-image-265" alt="SQLDWTablw" src="https://msdnshared.blob.core.windows.net/media/2016/10/SQLDWTablw.jpg" />]]></content:encoded>
    </item>
    <item>
      <title>#RioOlympics2016 Twitter Sentiment Analytics using Azure Stream Analytics &amp; Azure ML with Predictive Analytics using PowerBI</title>
      <link>https://docs.microsoft.com/archive/blogs/anindita9/rioolympics2016-twitter-sentiment-analytics-using-azure-stream-analytics-azure-ml-with-predictive-analytics-using-powerbi</link>
      <pubDate>Sun, 14 Aug 2016 16:28:58 GMT</pubDate>
      <dc:creator><![CDATA[Anindita-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anindita9/?p=45</guid>
      <description><![CDATA[[bing_translator]

Last year December 2015, Azure Machine Learning Team announced the availability...]]></description>
      <content:encoded><![CDATA[[bing_translator]

Last year December 2015, Azure Machine Learning Team announced the availability of integration of Azure Machine Learning deployed web services into Azure Stream Analytics as '<strong>Functions</strong>'. This feature is currently in preview till the date of writing this blog. So, in this blog post, we are going to see how to build a realtime twitter streaming sentiment analytics using <strong>Azure Service Bus Event Hub, Azure Stream Analytics + Azure ML predictive solution function &amp; finally building visualization using Microsoft PowerBI. </strong>

Here goes the end to end solution architecture diagram of realtime Twitter streaming sentiment analytics using raw tweets events collection to pushing events into Event Hub, then publishing through ASA through AML predictive analytics sentiment values &amp; finally implementing realtime sentiment scoring dashboard using PowerBI.

&nbsp;

[caption id="attachment_55" align="aligncenter" width="719"]<img width="719" height="690" class="size-full wp-image-55" alt="Solution Architecture" src="https://msdnshared.blob.core.windows.net/media/2016/08/SentimentAnalytics.jpg" /> Solution Architecture[/caption]

&nbsp;

So, first the realtime tweets are getting collected using Java eclipse code using Twitter4J library. So, the tweets event are collected based on this following keywords , <strong>#RioOlympics2016, #Rio2016</strong> etc. &amp; stored directly as .csv file into OneDrive. (Tweets event can be stored even directly event hubs as well).
<blockquote>
<p style="text-align: left">package com.hadoop;</p>
<p style="text-align: left">import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
import com.opencsv.CSVWriter;</p>
<p style="text-align: left">import twitter4j.FilterQuery;
import twitter4j.Place;
import twitter4j.StallWarning;
import twitter4j.Status;
import twitter4j.StatusDeletionNotice;
import twitter4j.StatusListener;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.TwitterStream;
import twitter4j.TwitterStreamFactory;
import twitter4j.User;
import twitter4j.conf.ConfigurationBuilder;</p>
<p style="text-align: left">public class TwitterText{</p>
<p style="text-align: left">public static void main(String[] args) {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true);
cb.setOAuthConsumerKey("");
cb.setOAuthConsumerSecret("");
cb.setOAuthAccessToken("");
cb.setOAuthAccessTokenSecret("");</p>
<p style="text-align: left">// gets Twitter instance with default credentials
TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();</p>
<p style="text-align: left">StatusListener listener = new StatusListener() {</p>
<p style="text-align: left">@Override
public void onException(Exception arg0) {
// TODO Auto-generated method stub</p>
<p style="text-align: left">}</p>
<p style="text-align: left">@Override
public void onDeletionNotice(StatusDeletionNotice arg0) {
// TODO Auto-generated method stub</p>
<p style="text-align: left">}</p>
<p style="text-align: left">@Override
public void onScrubGeo(long arg0, long arg1) {
// TODO Auto-generated method stub</p>
<p style="text-align: left">}</p>
<p style="text-align: left">@Override
public void onStatus(Status status) {
User user = status.getUser();</p>
<p style="text-align: left">// gets Username
String username = status.getUser().getScreenName();
// System.out.println(username);
String profileLocation = user.getLocation();</p>
<p style="text-align: left">// System.out.println(profileLocation);
long tweetId = status.getId();
// System.out.println(tweetId);
String content = status.getText();
// System.out.println(content +"\n");
String text = content;
String csv = "C:\\OneDrive\\RealtimeTweets\\RealTweets.csv";
String tweetText = null;
CSVWriter writer = null;
try {</p>
<p style="text-align: left">tweetText = content;
writer = new CSVWriter(new FileWriter(csv,true));
String[] finalOutput = tweetText.split(",");
writer.writeNext(finalOutput,true);
System.out.println(tweetText);
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}</p>
<p style="text-align: left">}</p>
<p style="text-align: left">@Override
public void onTrackLimitationNotice(int arg0) {
// TODO Auto-generated method stub</p>
<p style="text-align: left">}</p>
<p style="text-align: left">@Override
public void onStallWarning(StallWarning arg0) {
// TODO Auto-generated method stub</p>
<p style="text-align: left">}</p>
<p style="text-align: left">};
FilterQuery fq = new FilterQuery();</p>
<p style="text-align: left">String keywords[] = {"#Rio2016","#RioOlympics2016"};</p>
<p style="text-align: left">fq.track(keywords);</p>
<p style="text-align: left">twitterStream.addListener(listener);
twitterStream.filter(fq);</p>
<p style="text-align: left">}
}</p>
</blockquote>
<p style="text-align: left">Here's how it looks the output.</p>
<img width="1479" height="842" class="aligncenter wp-image-65 size-full" alt="TwitterJava" src="https://msdnshared.blob.core.windows.net/media/2016/08/TwitterJava.jpg" />

&nbsp;

Next, customize the Service Bus event hub to push realtime tweets into Event hub from OneDrive Storage.
<blockquote>
<p style="text-align: left">using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
using Microsoft.VisualBasic.FileIO;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;</p>
<p style="text-align: left">namespace SentTweetsToEventHub
{
class Program
{</p>
<p style="text-align: left">static string eventHubName = "&lt;your Event Hub name&gt;";
static string connectionString = GetServiceBusConnectionString();
static string data = string.Empty;</p>
<p style="text-align: left">static void Main(string[] args)
{
string[] filePath = Directory.GetFiles(@"C:\", "*.csv");
string csv_file_path = string.Empty;
int size = filePath.Length;
for (int i = 0; i &lt; size; i++)
{
Console.WriteLine(filePath[i]);
csv_file_path = filePath[i];
}</p>
<p style="text-align: left">DataTable csvData = GetDataTableFromCSVFile(csv_file_path);
Console.WriteLine("Rows count:" + csvData.Rows.Count);
DataTable table = csvData;
foreach (DataRow row in table.Rows)
{
//// Console.WriteLine("---Row---");
foreach (var item in row.ItemArray)
{</p>
<p style="text-align: left">data = item.ToString();
Console.Write(data);</p>
<p style="text-align: left">var eventHubClient = EventHubClient.CreateFromConnectionString(connectionString, eventHubName);
//while (true)
//{</p>
<p style="text-align: left">try
{
foreach (DataRow rows in table.Rows)
{
var info = new Tweets
{</p>
<p style="text-align: left">text = rows.ItemArray[0].ToString(),</p>
<p style="text-align: left">};</p>
<p style="text-align: left">var serializedString = JsonConvert.SerializeObject(info);
var message = data;
Console.WriteLine("{0}&gt; Sending events: {1}", DateTime.Now.ToString(), serializedString.ToString());
eventHubClient.SendAsync(new EventData(Encoding.UTF8.GetBytes(serializedString.ToString())));</p>
<p style="text-align: left">}
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("{0} &gt; Exception: {1}", DateTime.Now.ToString(), ex.Message);
Console.ResetColor();
}
Task.Delay(200);
//}</p>
<p style="text-align: left">}</p>
<p style="text-align: left">}
// Console.ReadLine();</p>
<p style="text-align: left">Console.WriteLine("Press Ctrl-C to stop the sender process");
Console.WriteLine("Press Enter to start now");
Console.ReadLine();</p>
<p style="text-align: left">// SendingRandomMessages().Wait();</p>
<p style="text-align: left">}</p>
<p style="text-align: left">private static DataTable GetDataTableFromCSVFile(string csv_file_path)
{
DataTable csvData = new DataTable();
string data = string.Empty;
try
{
using (TextFieldParser csvReader = new TextFieldParser(csv_file_path))
{
csvReader.SetDelimiters(new string[] { "," });
csvReader.HasFieldsEnclosedInQuotes = true;</p>
<p style="text-align: left">//read column names
string[] colFields = csvReader.ReadFields();
foreach (string column in colFields)
{
DataColumn datecolumn = new DataColumn(column);
datecolumn.AllowDBNull = true;
csvData.Columns.Add(datecolumn);
}
while (!csvReader.EndOfData)
{
string[] fieldData = csvReader.ReadFields();</p>
<p style="text-align: left">for (int i = 0; i &lt; fieldData.Length; i++)
{
if (fieldData[i] == "")
{
fieldData[i] = null;
}
}
csvData.Rows.Add(fieldData);</p>
<p style="text-align: left">}
}
}
catch (Exception ex)
{</p>
<p style="text-align: left">}
return csvData;
}</p>
<p style="text-align: left">private static string GetServiceBusConnectionString()
{
string connectionString = ConfigurationManager.AppSettings["EventHubConnectionString"];
if (string.IsNullOrEmpty(connectionString))
{
Console.WriteLine("Did not find Service Bus connections string in appsettings (app.config)");
return string.Empty;
}
ServiceBusConnectionStringBuilder builder = new ServiceBusConnectionStringBuilder(connectionString);
builder.TransportType = Microsoft.ServiceBus.Messaging.TransportType.Amqp;
return builder.ToString();
}</p>
<p style="text-align: left">static async Task SendingRandomMessages()
{
var eventHubClient = EventHubClient.CreateFromConnectionString(connectionString, eventHubName);
while (true)
{
try
{
var message = data;
Console.WriteLine("{0}&gt; Sending events: {1}", DateTime.Now.ToString(), message);
await eventHubClient.SendAsync(new EventData(Encoding.UTF8.GetBytes(message)));
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("{0} &gt; Exception: {1}", DateTime.Now.ToString(), ex.Message);
Console.ResetColor();
}
await Task.Delay(200);
}</p>
<p style="text-align: left">}</p>
<p style="text-align: left">}
}</p>
</blockquote>
&nbsp;

Now, configure the ASA job to add Azure Event Hub as data stream &amp; add ASA-SQL query along with AML function. The ASA-SQL with Azure machine learning twitter sentiment predictive analytics function looks like the following.

<img width="1077" height="669" class="aligncenter size-full wp-image-75" alt="ASA-SQL" src="https://msdnshared.blob.core.windows.net/media/2016/08/ASA-SQL.jpg" />

&nbsp;

Provision Twitter Predictive Sentiment analysis model from Cortana Intelligence gallery. Download the mini-twitter sentiment analysis predictive model from <strong><a href="https://gallery.cortanaintelligence.com/Experiment/Predictive-Mini-Twitter-sentiment-analysis-Experiment-1">here</a></strong>. Take the ML web service URL &amp; key from the Excel 2010 template &amp; paste it within ASA 'Functions' tab to integrate AML analysis model.

<img width="766" height="644" class="aligncenter size-full wp-image-85" alt="AML" src="https://msdnshared.blob.core.windows.net/media/2016/08/AML.jpg" />

Next, add the output as Azure Blob storage to store the tweets &amp; sentiment scores &amp; implement powerbi sentiment analytics from it.

<img width="1064" height="475" class="aligncenter size-full wp-image-95" alt="output" src="https://msdnshared.blob.core.windows.net/media/2016/08/output.jpg" />

&nbsp;

Finally, collect the sentiment scores output .csv files from the blob storage. Implement PowerBI dashboard from it.

<img width="1799" height="244" class="aligncenter size-full wp-image-105" alt="Blob" src="https://msdnshared.blob.core.windows.net/media/2016/08/Blob.jpg" />

&nbsp;

The final Tweet events with sentiment scores output looks like as the following screenshot.

<img width="1616" height="617" class="aligncenter size-full wp-image-125" alt="Scores" src="https://msdnshared.blob.core.windows.net/media/2016/08/Scores.jpg" />

<img width="1364" height="783" class="aligncenter size-full wp-image-115" alt="PBI" src="https://msdnshared.blob.core.windows.net/media/2016/08/PBI.jpg" />

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Optimizing Hadoop using Microsoft Azure HDInsight &amp; Real-world data streaming with HDInsight Spark, Storm &amp; NoSQL HBase cluster</title>
      <link>https://docs.microsoft.com/archive/blogs/anindita9/optimizing-hadoop-using-microsoft-azure-hdinsight-real-world-data-streaming-with-hdinsight-spark-storm-nosql-hbase-cluster</link>
      <pubDate>Thu, 11 Aug 2016 21:54:46 GMT</pubDate>
      <dc:creator><![CDATA[Anindita-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anindita9/?p=35</guid>
      <description><![CDATA[[bing_translator]

Last month, I presented on Microsoft Virtual Partner Tech Days India 2016 on...]]></description>
      <content:encoded><![CDATA[[bing_translator]

Last month, I presented on Microsoft Virtual Partner Tech Days India 2016 on Azure HDInsight &amp; Apache HBase, Storm &amp; Spark clusters. Here goes the video links of these two webinars.
<ul>
 	<li><strong>Optimizing Hadoop using Microsoft Azure HDInsight</strong></li>
</ul>
[embed]https://youtu.be/mrMsi572RVU[/embed]

&nbsp;
<ul>
 	<li><strong>Real-world Data Streaming Analysis using Azure HDInsight HBase, Storm &amp; Apache Spark</strong></li>
</ul>
[embed]https://youtu.be/bZwdUcWIOLM[/embed]

&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>