Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This blog is part of IoT Series, where I am trying to build few IoT devices that push events to Azure EventHub. From the EventHub, Azure Stream Analytics will execute my query to calculate average values for each individual device and publish these average values to Azure ServiceBus. From Azure ServiceBus, I am going to read the average values in Azure Functions Apps and save them into Azure Redis Cache. My Azure Website will poll this Redis Cache and displays the average values.
Here are list of blog posts in this series:
In this blog, I am going to show how to configure Azure Stream Analytics to read from Azure EventHub, run Query and save results to Azure ServiceBus.
Login to Azure Portal (https://portal.Azure.com)
Click on + New button
In the Search, type Stream Analytics
Select Stream Analytics Jobs and click Create button
Click on Create button
Once this Stream Analytics Job is deployed, navigate to this newly created Stream Analytics Job
Click on the Overview, select Input, click Add and in the New Input select the source as EventHub as shown below
Now select the Output, click on Add button and set the New Output source to ServiceBus Queue as show below
Now set the query, click on Query, in the query editor type this below query
SELECT
DeviceName, AVG(temperature) as AvgTemp, AVG(speed) as AvgSpeed
FROM
fromWabacEventHub TIMESTAMP BY datetime
Group BY
DeviceName,
TumblingWindow(second, 10)
Now start the Stream Analytics Job, by clicking on the Start button
To check if the query is getting executed and results are saved to ServiceBus, in the console app run these two functions SendEvents(10) and CheckIfServiceBusGotEvents()
Complete code is here
Next, we will configure Azure Function Apps to read from Azure ServiceBus and write it to Azure Redis Cache. Click here for next blog
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in