<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stream Analytics tool &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/stream-analytics-tool/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Fri, 11 Jan 2019 09:41:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Stream Analytics tool &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Azure Stream Analytics Job and Tools for Visual Studio</title>
		<link>https://sibeeshpassion.com/azure-stream-analytics-job-and-tools-for-visual-studio/</link>
					<comments>https://sibeeshpassion.com/azure-stream-analytics-job-and-tools-for-visual-studio/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 13 Dec 2018 13:13:50 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Azure IoT]]></category>
		<category><![CDATA[Data Lake]]></category>
		<category><![CDATA[MXChip]]></category>
		<category><![CDATA[Stream Analytics Job]]></category>
		<category><![CDATA[Stream Analytics tool]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13461</guid>

					<description><![CDATA[[toc] Introduction Creating an Azure Stream Analytics job and working with them is always a fun. And what if there is a tool which helps you create a stream solution in Visual Studio so that you don&#8217;t want to go over the browser and do some manual button clicks? That&#8217;s where the Azure Data Lake and Stream Analytics Tool extension come into the play. In my previous post, we have already discussed what is an Azure Stream Analytics job and how can we work with the same, if you haven&#8217;t read the same, please read it. Now let&#8217;s go and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction</h2>



<p>Creating an <a href="https://sibeeshpassion.com/category/azure">Azure</a> Stream Analytics job and working with them is always a fun. And what if there is a tool which helps you create a stream solution in Visual Studio so that you don&#8217;t want to go over the browser and do some manual button clicks? That&#8217;s where the Azure Data Lake and Stream Analytics Tool extension come into the play. In my previous post, we have already discussed <a href="https://sibeeshpassion.com/an-introduction-to-azure-stream-analytics-job/">what is an Azure Stream Analytics job and how can we work with the same</a>, if you haven&#8217;t read the same, please read it. Now let&#8217;s go and use the extension.</p>



<h2 class="wp-block-heading">Background</h2>



<p>Recently, I started working with Azure IoT Device Kit, which is a wonderful micro controller board, it can send a lot of information like temperature, humidity to the Azure cloud, as it has a lot of inbuilt sensors. Now in this article, we will create a Visual Studio solution for our Stream Analytics Job so that the same can be moved to a source control and can be easily managed.&nbsp;</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Please be noted that the Extension we are going to use is not yet supported with Visual Studio 2019, and if you try to create the same in VS2019, you will get an error as&nbsp;<a href="https://stackoverflow.com/questions/53727170/azure-stream-analytics-tool-for-visual-studio-in-2019-preview/53727171#53727171">the version of Visual Studio is not supported</a></p><cite>The extension is not supported in VS2019</cite></blockquote>



<h2 class="wp-block-heading">Setting up the Environment</h2>



<p>I am assuming that you have a valid Azure Subscription and you have access to create the resouces in it.&nbsp;</p>



<h3 class="wp-block-heading">Modify Visual Studio with Required Workloads</h3>



<p>Let&#8217;s go to our Visual Studio installer and modify the workloads now.</p>



<div class="wp-block-image"><figure class="aligncenter"><img fetchpriority="high" decoding="async" width="651" height="209" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Install-the-Required-Workloads.jpg" alt="" class="wp-image-13464" srcset="/wp-content/uploads/2018/12/Install-the-Required-Workloads.jpg 651w, /wp-content/uploads/2018/12/Install-the-Required-Workloads-300x96.jpg 300w, /wp-content/uploads/2018/12/Install-the-Required-Workloads-400x128.jpg 400w" sizes="(max-width: 651px) 100vw, 651px" /><figcaption>Install the Required Workloads</figcaption></figure></div>



<p>Once the workloads are modified, make sure that the extension is available in your Extensions, you can do that by going to Tools -&gt; Extension menu.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="650" height="451" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Azure-Data-Lake-Extension.jpg" alt="" class="wp-image-13463" srcset="/wp-content/uploads/2018/12/Azure-Data-Lake-Extension.jpg 650w, /wp-content/uploads/2018/12/Azure-Data-Lake-Extension-300x208.jpg 300w, /wp-content/uploads/2018/12/Azure-Data-Lake-Extension-160x110.jpg 160w, /wp-content/uploads/2018/12/Azure-Data-Lake-Extension-400x278.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Azure Data Lake Extension</figcaption></figure></div>



<h3 class="wp-block-heading">Creating a New Stream Analytics Project</h3>



<p>Once the Extension is enabled, you should be able to create a new Azure Stream Analytics Application.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="651" height="359" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Azure-Stream-Analytics-Application.jpg" alt="" class="wp-image-13465" srcset="/wp-content/uploads/2018/12/Azure-Stream-Analytics-Application.jpg 651w, /wp-content/uploads/2018/12/Azure-Stream-Analytics-Application-300x165.jpg 300w, /wp-content/uploads/2018/12/Azure-Stream-Analytics-Application-400x221.jpg 400w" sizes="(max-width: 651px) 100vw, 651px" /><figcaption>Azure Stream Analytics Application&nbsp;</figcaption></figure></div>



<p>The new project will be containing the below files.</p>



<ol class="wp-block-list"><li>Input.json</li><li>Output.json</li><li>JobConfig.json</li><li>Script.asaql</li></ol>



<p>To&nbsp;configure your subscription, please make sure that you have added your&nbsp;Subscription in the Server Explorer.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="435" height="544" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Azure-Server-Explorer.jpg" alt="" class="wp-image-13470" srcset="/wp-content/uploads/2018/12/Azure-Server-Explorer.jpg 435w, /wp-content/uploads/2018/12/Azure-Server-Explorer-240x300.jpg 240w, /wp-content/uploads/2018/12/Azure-Server-Explorer-400x500.jpg 400w" sizes="(max-width: 435px) 100vw, 435px" /><figcaption>Azure Server Explorer</figcaption></figure></div>



<p>The Input.json file is the replica of your Input job topology, <g class="gr_ gr_120 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="120" data-gr-id="120">double click</g> on the file will give you the configuration page to configure the details.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="1024" height="982" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Input-Configuration-1024x982.jpg" alt="" class="wp-image-13466" srcset="/wp-content/uploads/2018/12/Input-Configuration-1024x982.jpg 1024w, /wp-content/uploads/2018/12/Input-Configuration-300x288.jpg 300w, /wp-content/uploads/2018/12/Input-Configuration-768x736.jpg 768w, /wp-content/uploads/2018/12/Input-Configuration-400x384.jpg 400w, /wp-content/uploads/2018/12/Input-Configuration-626x600.jpg 626w, /wp-content/uploads/2018/12/Input-Configuration.jpg 1504w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Input Configuration</figcaption></figure></div>



<p>The Output.json file is your output job topology, you can have as many outputs you need. In my case it is just one, SQL Server Database.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="650" height="485" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Output-Configuration.jpg" alt="" class="wp-image-13467" srcset="/wp-content/uploads/2018/12/Output-Configuration.jpg 650w, /wp-content/uploads/2018/12/Output-Configuration-300x224.jpg 300w, /wp-content/uploads/2018/12/Output-Configuration-400x298.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Output Configuration</figcaption></figure></div>



<p>You can always configure your job using the JobConfig.json file. When you configure the Job, you need to be sure about the values you are providing and what are the needs of them.&nbsp;</p>



<p><strong>Data Locale</strong> is your locale input. The option <strong>Output Error Handling</strong> is for handling the situation when the events fail to be written to the output, you can select either Drop or Retry. The <strong>Late Arrival Tolerance Window</strong> is the timeframe which you can wait for the event to reach the IoT hub, the time difference is between the event timestamp and the system time. </p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="650" height="416" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/JobConfiguration.jpg" alt="" class="wp-image-13468" srcset="/wp-content/uploads/2018/12/JobConfiguration.jpg 650w, /wp-content/uploads/2018/12/JobConfiguration-300x192.jpg 300w, /wp-content/uploads/2018/12/JobConfiguration-400x256.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Job Configuration</figcaption></figure></div>



<p>And the Script.asaql is the file where you need to add your custom query which gets data from the input and send it to the output.&nbsp;</p>



<pre class="wp-block-code"><code>SELECT
    messageId,
    deviceId,
    temperature,
    humidity,
    pressure,
    pointInfo,
    IoTHub,
    EventEnqueuedUtcTime,
    EventProcessedUtcTime,
    PartitionId
INTO
    streamoutputs
FROM
    streaminputs</code></pre>



<p>Once everything is done, you are ready to submit the same to the Azure. You can either create a new job or use the existing one.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" width="651" height="280" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Submit-Job.jpg" alt="" class="wp-image-13469" srcset="/wp-content/uploads/2018/12/Submit-Job.jpg 651w, /wp-content/uploads/2018/12/Submit-Job-300x129.jpg 300w, /wp-content/uploads/2018/12/Submit-Job-400x172.jpg 400w" sizes="(max-width: 651px) 100vw, 651px" /><figcaption>Submit Job</figcaption></figure></div>



<p>When you submit, you can see that a new Stream Analytics view will get opened and the job will be starting automatically. You can always see the blobs created under your container by going to the cloud explorer.&nbsp;</p>



<figure class="wp-block-image"><img decoding="async" width="650" height="300" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Cloud-Explorer-Blob-Container-View.jpg" alt="" class="wp-image-13471" srcset="/wp-content/uploads/2018/12/Cloud-Explorer-Blob-Container-View.jpg 650w, /wp-content/uploads/2018/12/Cloud-Explorer-Blob-Container-View-300x138.jpg 300w, /wp-content/uploads/2018/12/Cloud-Explorer-Blob-Container-View-400x185.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Cloud Explorer</figcaption></figure>



<p>Now just right click on your solution and select &#8220;Add solution to Source Control and then push the same to your git repository. Once you have added the solution to the source control, your team members can easily update the Input and Output configuration and have a history of the same.&nbsp;</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>In this article, we have learned how to,</p>



<ol class="wp-block-list"><li>set up the Visual Studio for using Data Lake and Stream Analytics tool</li><li>use the Data Lake and Stream Analytics tool</li><li>configure the Input for Stream Analytics</li><li>configure the Stream Analytics Job</li><li>Use the created package in another solution</li></ol>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. I will come back with another post on the same topic very soon.&nbsp;Did I miss anything that you may think which is needed? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/azure-stream-analytics-job-and-tools-for-visual-studio/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
