Azure function IoTHub device connection state message decode error

Nayangiri Goswami 45 Reputation points
2024-09-10T07:02:24.6533333+00:00

I've a route to forward Azure IoTHub device connection state messages to service bus queue.
On that queue I'm triggering Python function using v2 programming model.

Looks like the trigger is not being decoded properly. Here is the error,

Result: Failure Exception: ValueError: cannot convert value of field 'SequenceNumber' in trigger metadata into int: invalid literal for int() with base 10: '000000000000000001dummy100000004000000000000000000

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
635 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,110 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,201 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. akinbade abiola 18,305 Reputation points
    2024-09-10T07:37:49.23+00:00

    This is a python error. You need to check if you input string contains characters that are not valid digits for a base 10 number. See simple explanation here: https://www.geeksforgeeks.org/how-to-fix-valueerror-invalid-literal-for-int-with-base-10-in-python/

    Also: https://learn.microsoft.com/en-us/azure/iot-hub/troubleshoot-error-codes?source=recommendations

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.