Ollie F
Ollie F

Reputation: 67

Azure Stream Analytics Unique EventId Property is NULL

I'm looking to assign a unique Id to each event that is processed via Azure Stream Analytics (IoT Hub input source).

It appears there is no way to just assign a new random Guid in ASA (like in SQL) but I did come across the following MSDN article which mentions being able to use the GetMetadataPropertyValue function to achieve what I want with the EventId property:

Creates a unique id (Guid) for an input event, which can be useful for primary key purposes. It is consistent (not random) i.e., Stream Analytics will produce the same id for an event, if you go back in time and re-read the same input event.

The issue I have is this function returns NULL each time when I try it in the query builder. Am I missing something or is there another way to achieve a Unique Id for an event?

Upvotes: 0

Views: 1351

Answers (1)

Jean-Sébastien
Jean-Sébastien

Reputation: 737

Unfortunately this property doesn't work when you test it from sample data (we need some additional metadata). However you should get the GUID value when you run the job on live data from Event Hub or IoT Hub.

Let me know if it works for you! Sorry for the inconvenience.

JS

Upvotes: 3

Related Questions