This is a two-part demonstration. The first part was released in September 2021 for the Azure Back To School Event. The second part was released in December 2021 for connecting the Azure Digital Twins instance to a Time Series Insights environment to visualize your telemetry data.
The first part takes you through the set up of the IoT hub, connection of the trailer sensors, creation of the Azure Function project, and an Event Grid trigger that sends telemetry to your Azure Digital Twins instance.
Blog Post: Azure Back To School - Developing with Azure Digital Twins
Video: Azure Back To School - Developing with Azure Digital Twins
The second part takes you through the set up of the Event Hubs and the connection between the Azure Digital Twins and the Event Hubs via a second function in the Azure Functions project. Since both are necessary and they do not conflict, for ease of delivery I decided to include both functions in the same project - you could separate them if you wanted to do so.
Blog post: Festive Tech Calendar
I hope you have found these videos and this code useful. I would love your feedback. Please feel free to connect with me on linked in or via twitter and let me know your thoughts.