Hi @GuidoL Greetings! Thank you for posting the question here. While there is no straight approach to update the Telemetry data of Azure Digital Twin using Azure functions, there is a method available to publish the telemetry data using a Digital Twin to an end point listener. You can leverage this for your testing and simulate the data to an end point.
DigitalTwinClient class provides a PublishTelemetryAsync
method which Publishes telemetry from a digital twin asynchronously. The result is then consumed by one or many destination endpoints (subscribers) defined under DigitalTwinsEventRoute. Please refer the documentation on the Method for more detials.
You can publish the Telemetry data using the following line of code
await client.PublishTelemetryAsync(deviceId, Guid.NewGuid().ToString(), "{\"Temperature\": 5}");
As you are already aware, Telemetry
data is not explicitly stored anywhere unless we create an End point listener. If you would like to avoid the usage of property, this might be a good approach that you can test with.
Please also refer the article Process Azure Digital Twins data updates with the new Azure Function Extension Libraries which provides you the steps needed to set up and Event Hub end point and consume the Simulated data through an Azure function.
Hope this helps. Please let us know if you have any additional questions in the comments below.
If the response helped, please do click Accept Answer and Yes. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.