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?
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
Related
I am "connecting" CosmosDB to an Azure Function by change feed binding. I wonder if there is a way to trigger change feed only when certain property has some specific value.
For instance, a new user is inserted in CosmosDB. Then, run the Azure Function only when the user has user.email != null.
I could filter this out in the Azure Function of course. Just concern about the pricing filtering out potentially thousands of events I don't need.
No this is not currently possible.
There is a 5 year old request on the Feedback site and a response saying the "feature is now planned" but it is unclear when that response was posted as there is no date on it.
For the time being at least you need to filter out any documents not matching your criteria within the function itself rather than being able to get this done server side by CosmosDB when sending the batch of changes.
What I'm currently trying to get my head around is the ability to integrate the modelId from an Azure Digital Twin instance within Time Series Insights. I understand that Time Series Insights (Gen2) accepts the datatype of a string, however when I try to initiate that state, it doesn't appear within TSI when a connection is successfully established between Azure Digital Twin and Time Series Insights.
Streaming logs showing the modelId being recognised but not parsed into TSI:
Is there potentially a way to define this modelId so that it can be viewed as an instance or even as a hierarchy within Time Series Insights, so that I don't manually have to this step?
Many thanks,
Matas
Device id / some meaningful attributes from event source to be mapped as timeseriesid. TSI will automatically map with the event source once we set the attribute. We can set multiple attributes. This should be done during the creation of TSI. Once created, you cannot change the timeseriesid.
Add modelId as timeseriesid. It should solve your issue.
I am assuming you are trying to insert modelID as one of the instance field of an instance in TSI through its ingestion service.
If that is the case, unfortunately we cant insert instance fields through ingestor service. Instead you can call the API to insert instance field and its values. The API could be called from your Translator function or using upload JSON option in TSI model page.
TSI has its own syntax please refer to the attachment for details
Screenshot showing syntax for inserting instance field with its value:
Please refer to the following documentation for information about TSI model, Patch Syntax and API details!
https://learn.microsoft.com/en-us/azure/time-series-insights/concepts-model-overview
https://learn.microsoft.com/en-us/rest/api/time-series-insights/dataaccessgen2/timeseriesinstances/executebatch#instancesbatchput
Please let me know if I could be of further help!
I tried to receive desired properties update notifications by subscribing topic "$iothub/twin/PATCH/properties/#" (reference) and also by sdk (refernece). Both went okay and I did get notifications when I changed the desired properties by back-end services, but with all the desired properties in response. Is there a topic or a function in sdk to just get the properties that where changed? Or to know witch properties were changed without looking through all the desired properties?
Appreciate your help!
You should use a PATCH request to update a desired property in your back-end service. The following screen snippets show an example of the updating only one desired property such as color. For quick demonstration purpose, the Azure IoT Hub Tester is used:
Creating two desired properties (color, abc):
device8 received a changes notification (version=2):
In this step, we need to update only one desired property (color):
device8 received a changes notification (version=3) such as the preperty color:
As you can see in the above pictures, the device8 subscribed on the topic like you mentioned it. You didn't describe how your backend service updating your desired properties.
Note, that the above example using the REST PATCH call for updating a desired properties.
The Alexa List API FAQ says as follows:
How can a developer determine that an event has been triggered due to their skill?
Consider this scenario:
The customer creates a to-do in the app.
The skill service uses the Skill Messaging API to send a message to the skill to create a list item in Alexa.
The skill receives the Skill Messaging API message and POSTs to householdlist and list items.
In response to the POST, the skill service records the alexa_item_id locally. An ItemsCreate event also occurs as a list item was just created. Alexa triggers an event even if a list item is created by calling List API. Skill developers can use the item_id value returned by CreateListItem to uniquely identify an item.
Now my question:
Is there any more precise information / sample on that? (I am still new to node.js and alexa development)
In my current skill implementation (AWS Lambda endpoint) list elements are added via ask list API which results in return in receiving the ItemsCreated event a few seconds later in the same lambda.
Currently I cannot filter out events like that which results in en endless circular update loop. The same is true for delete events while it stops after the first try here.
How can I determine that I can skip this event?
Where/how shall I store/cache this (e.g. the item_id mentioned above) information?
How do I get to this information seconds later (while other users may have called into the lambda meanwhile)?
Note:
Both happens out of session.
Seems there is no built-in way to achieve that.
From the FAQ I conclude that I need my own persistency (e.g. dynamoDB) and store item_id / user_id there in order to check the events.
https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs#persisting-skill-attributes-through-dynamodb
If any concerns or any easier way applicable - please let me know.
Ok You must use the Api with webhook
so, for any webhook event comes from system A , you must do a request api to the system B to get the data about this Item e.g
then you must compare the data which come by webhook and the data that return from api , if no difference then stop
else continue in effecting in the System B
I have an Azure Logic App that sends a message to a Topic using the Azure Service Bus Connector. I even use the Properties field and the values are indeed propagated together with the message.
But for some reason filtering doesn't work on these properties, though the filter works when sending a message with another tool (like Service Bus Explorer).
SB Connector, that sets Properties:
Message send to Topic in SB and visible in Subscription without Filter. (Rule 1=1)
But this message is never available in a Subscription with Filter.
Though messages sent with other "Publishers" (e.g. Test with SB Explorer) do appear in this subscription if they match the filter criteria.
Any ideas what's going wrong?
My guess right now (and I'll verify this later today) is that the current Service Bus Connector is casting all properties as "strings" and not detecting when it is an Int32, so the rule isn't successfully working. Can you try either modifying your rule to detect the string "1" or modifying the property to send a string and see if that works? If so we should be able to add the work to deal with integers better when in properties. Let me know
EDIT: After looking into it, this appears to be the case. If you can verify treating it as a string works I'll know for sure where we have the gap and can work on prioritizing the fix.