Azure / Azure/azure-functions-host

Azure Function for IoT Hub default code - portal test fails

Open
#4,085 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

#### Investigative information

Please provide the following:

- Timestamp: 2019-02-14T17:45:14.990
- Function App version (1.0 or 2.0): 2.0
- Function App name: cdioth
- Function name(s) (as appropriate): IoTHub_Az_Fnc_Test
- Invocation ID: 1f87c5f3-e4b2-4574-8b9e-3c68f477ce8a
- Region: West US

#### Repro steps

Provide the steps required to reproduce the problem:

1. Create an Azure Function with the default IoTHub trigger binding in the portal
2. Run the default test (the string - 'Test message' ) with the default code in the portal.

#### Expected behavior

The default code successfully calls context.log() on the data that appears in the test section of the portal such that either the default code is updated or the test message is updated to reflect the expected format.

#### Actual behavior

Running the default code throws an error.

```
2019-02-14T17:55:36.556 [Error] Executed 'Functions.IoTHub_Az_Fnc_Test' (Failed, Id=2647a679-894c-449f-9902-40e11ca11947)
Binding parameters to complex objects (such as 'Object') uses Json.NET serialization.
1. Bind the parameter type as 'string' instead of 'Object' to get the raw values and avoid JSON deserialization, or
2. Change the queue payload to be valid json. The JSON parser failed: Invalid character after parsing property name. Expected ':' but got: }. Path '', line 1, position 15.
```
#### Known workarounds

Unknown as I have yet to determine what data format is expected.

#### Related information

* Programming language used : Javascript/Node
* Bindings used: IoTHub

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the portal's default IoT Hub trigger binding, the default JavaScript/Node code, and the default test message. Check the expected payload format at the binding and portal-test entry points; done means the default code successfully logs the test data without the JSON parsing error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, node.js
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.