Hello @----- Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
Based on the information you have provided in the question if your Azure function is not receiving any telemetry, it implies that the Azure function is not listening to the routing end point of IoT Hub where the data is being routing. When you monitor the events from Azure IoT Explorer, the data is typically monitored on the built in end point of IoT Hub by default. Please refer the below image.
Assuming you have followed the same steps from the guide Tutorial: Build out an end-to-end solution you would have configured your Azure function to listen to Event Grid. This is done by executing the below command from the section Connect the IoT hub to the Azure function
az eventgrid event-subscription create --name <name-for-hub-event-subscription> --event-delivery-schema eventgridschema --source-resource-id /subscriptions/<your-subscription-ID>/resourceGroups/<your-resource-group>/providers/Microsoft.Devices/IotHubs/<your-IoT-hub> --included-event-types Microsoft.Devices.DeviceTelemetry --endpoint-type azurefunction --endpoint /subscriptions/<your-subscription-ID>/resourceGroups/<your-resource-group>/providers/Microsoft.Web/sites/<your-function-app>/functions/ProcessHubToDTEvents
In addition to the above configurations, you would also need to grant your Azure function Azure Digital Twins Data Owner
to provide write permissions. Please refer the section Assign access role for more details on this.
You can find a complete code sample on the end-to-end implementation in Python from the following similar threads which have been addressed in the past.
- Ingest Telemetry from IoT Hub to Azure Digital Twin using Python Error
- Ingest Telemetry from IoT Hub to Azure Digital Twin using Python
Hope this helps. If you still have any additional questions or need further assistance, please let us know in the comments below.
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.