question

AnuragShelar-8594 avatar image
0 Votes"
AnuragShelar-8594 asked AnuragShelar-8594 commented

Stream Analytics on Edge with OPC UA Publisher

Hi @SandervandeVelde42 , followed your blog post for Getting Started with OPC UA Publisher . It made my life a lot more simpler. So Thank you for that.

Now that I have my OPC Publisher module running on Edge, I would like to filter some data before sending it to IOT hub. So for that I would like to run Stream Analytics on Edge module.
I needed some help in this context. Such as what should my routes be, how should I write the query.

The json my OPC Publisher module is sending to IOT Hub currently if of the form.
{"NodeId":"http://www.prosysopc.com/OPCUA/SimulationNodes/#i=1004","ApplicationUri":"urn:host.docker.internal:OPCUA:SimulationServer","DisplayName":"Temperature","Value":{"Value":1.902113,"SourceTimestamp":"2021-04-28T10:47:06Z"},"EventProcessedUtcTime":"2021-04-28T10:48:27.0652993Z","PartitionId":1,"EventEnqueuedUtcTime":"2021-04-28T10:47:15.5030000Z","IoTHub":{"MessageId":null,"CorrelationId":null,"ConnectionDeviceId":"opauavm","ConnectionDeviceGenerationId":"637551916393812820","EnqueuedTime":"2021-04-28T10:47:15.5110000Z"}}


PS: By filtering data, I mean I would like to have some conditions like if pressure>30 or temperature<70, only then I should be able to send data to IOT hub.

azure-iot-hubazure-iot-edgeazure-stream-analytics
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SandervandeVelde42 avatar image
1 Vote"
SandervandeVelde42 answered AnuragShelar-8594 commented

Hello @AnuragShelar-8594 ,

thanks for letting me know my blog is helping you a lot.

You want to run an Azure Stream Analytics Job on the edge. This is a great way to handle data locally indeed.

I recommend starting to gain experience with Azure Stream Analytics with the MS Learn learning path.

From there, play with the use case you have in mind using Visual Studio Code or Visual Studio (building a query in the Portal browser is great for demonstration but you lack version control and building up a history of queries you can roll back).

You do not have all cloud capabilities on the edge (it's just an IoT device after all) so check out the edge limitations before you are going to design the edge queries.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks ..That really helped.

0 Votes 0 ·