How can i connect Azure Digital Twin to a NTP server to get the synchronized time for the timestamp?

Xuezhou Hou 25 Reputation points
2023-08-17T08:58:31.63+00:00

Hello all,

I am recently working with Azure Digital Twin for delay measurement, and i want to know the exact timestamp of the data of an digital twin instance getting updated. However, I did not find any information about which clock the timestamp is based on. Is that possible to synchronize the time with a NTP-Server (e.g.: my computer's software clock)?

Thank you in advanced!

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
221 questions
Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
489 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
568 questions
{count} votes

Accepted answer
  1. Sander van de Velde 29,691 Reputation points MVP
    2023-08-17T12:50:04.0966667+00:00

    Hello @Xuezhou Hou ,

    There are several services handling the incoming device message (eg. Azure IoT Hub -> Event Hub -> Azure Function -> ADT).

    Azure uses internal clocks (based on UTC) for these services.

    Only the logic that actually sends the twin update (like an Azure Function), knows the moment the update was sent. Because Twin changes (per property) are handled after each other, you will make updating of each property smarter if you want to 'group' them, using the technique seen above (see comment from AshokPeddakotla-MSFT).

    I expect the incoming messages already have a timestamp in the message body, based on the (utc) time in the devices.

    If you want to synchronize these devices, you need to check each devices how it synchronizes to either an internet provide clock service or a NTP server on the local network (eg. synchronizing with GPS).

    Then, you could add extra timestamps based on the times made available by the different Azure resources (like seen in the System properties of IoT Hub or Event Hub messages).

    I also recommend enabling the ADT history feature using Azure Data Explorer. This gives you full control over the historical twin changes.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

0 additional answers

Sort by: Most helpful