Hi @Goli, Shyam Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
not able to view the data in the IOT explorer
Based on the information you have shared, it is highly likely that you are routing events to a custom End point on IoT Hub, which you are using to trigger the Azure function. In Azure IoT Explorer, when you try to view telemetry on a device, the default option that is selected for monitoring is built-in Event Hub end points. Please refer the below image to find this setting.
You can disable this setting and provide your Custom Event Hub endpoint to view telemetry through Azure IoT Explorer. You can also leverage Azure IoT Tools on Visual Studio Code to monitor custom endpoints. If you are new to the IoT Hub routing and would like to get more understanding on this concept, please refer to the following resources.
- Use IoT Hub message routing to send device-to-cloud messages to different endpoints
- Create and delete routes and endpoints by using the Azure portal
Azure function is also successfully processing the data but again could not view the data
I assume that you could not see the data being processed within the Azure functions. Here are a couple of possibilities you can try to get better understanding on the data being processed by your Azure function.
- Put logger statements such as
logger.info
within your code and print out the data being received/processed. Once you redeploy the code and the function gets triggered, you can view the detailed messages for every invocation under monitor section of your Azure function. Please refer the below image for reference - You can configure your Azure functions to run locally in Visual Studio Code and debug the code. Here is a link providing steps - Run Azure functions locally
the data is not updating on the digital twin
We would need more details on your Azure functions invocation messages/logs to get more details on how the data is being processed to better guide you on this issue. Here is a Tutorial on Azure Digital Twins- Build out an end-to-end solution which provides detailed steps on the same use case on how to simulate data from Azure IoT Hub and update a digital twin through Azure functions.
Please note that if you are using a custom Model for your Azure Digital twin, you would have to update your Azure function code to update the corresponding property matching the model. If you run into any issues testing the code, please refer to a similar question, Telemetry Data from IOT hub not pushing to azure function and not reflecting to Digital Twin asked in the past where detailed explanations are given around the code functioning.
Hope this helps. Please feel free to reach out to us with any additional questions through the comments.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.