Integrating modelId from Azure Digital Twin into Time Series Insights - azure

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!

Related

Conditional Cosmos DB Change Feed

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.

ADF pipeline system variables for meta data tracking

I'm currently working on a stored procedure script to pull all the pipeline and system variables and insert them into a control table for auditing and monitor purposes, however struggling to find the correct variable for two values #run and #run_id. Run in this context is the value in the ADF monitor page for whether a pipeline run is original or a rerun:
Solved the second query, see comments: The second value is the run_id, as returned by #activity('Sample Copy Activity').output.RunId, but placed within a for loop. At the moment this returns the pipeline's RunID, but I'd like to obtain the Copy Activity's ID.
The #pipeline().GroupId returns the same value as the above output.RunId, so unsure how the RunId and GroupId variables differ? Any advice, pointers to documentation or values for the what to enter into the stored procedures parameters in the second image. Thank you!
I've checked the Azure Documentation in detail, searched various forums and stack overflow for a complete list of system and pipeline variables and tested all provided parameter/variable names. Can only assume that the documentation is not complete or the values are not able to be ontained.
AFAIK, In ADF there is no particular API that has this property(Run - original or Rerun).
But you can try by getting the logs by Diagnostics settings of ADF(I have not tested).
Create a storage account in same Data factory and select archive to storage account.
Select storage account or send to log Analytics workspace and get that using ADF.

Azure IoT Devices Receiving Twin Update Notifications

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.

Retrieve Azure AppInsights Live Metrics through API

There is an one year old question How can I retrieve through an API *Live Metrics* of Microsoft Application Insights about is it possible to pull LiveMetrics data that appInsights generate for the application trough some API
Right now i don't see anything live related in the official documentation - https://dev.applicationinsights.io/reference . And the answer for old question was also that there is no any way to get them.
But maybe someone knows if AppInsights team plans were changed in this year and they are working on that API?
It might be really useful to pull that data in realtime through API to own alerting\metrics system to process data from different microservices\applications and display them in aggregated way in realtime.
As example we can build something like OpServer has but based on different applications and their AppInsights data .
As right now there is no any way to get it
Note: I work in Application Insights team at Microsoft.
LiveMetrics data is not persistently stored anywhere, and there is no API to retrieve it. The data is collected only when someone is actively on the Live Metrics portal page. The moment browser window is closed, data is gone as well.
If your goal is to get metrics/other in real-time, then you can do that by implementing own ITelemetryProcessor. Most people use ITelemetryProcessor to "filter" out unwanted telemetry. But that is not a rule. All telemetry passes through TelemetryProcessor, and you can chose to filter the data or do something else with it. In your case you want to send it instantly to some real-time service. In fact, LiveMetrics (internally known as QuickPulse) is implemented as a TelemetryProcessor. (https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/WEB/Src/PerformanceCollector/Perf.Shared/QuickPulseTelemetryProcessor.cs#L158)
General doc about TelemetryProcessor:
https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling#create-a-telemetry-processor-c

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?
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

Resources