I am using 1x functions, my question is, if with this version, I can receive an object of type EventData.
I have read documentation about it, but it has not been clear to me.
When executing the function, throw the following exception:
mscorlib: Exception while executing function: eventHubTest. Microsoft.Azure.WebJobs.Host: Se han producido uno o varios errores. Exception binding parameter 'myEventHubMessage'. Microsoft.Azure.WebJobs.Host: Binding parameters to complex objects (such as 'EventData') uses Json.NET serialization. 1. Bind the parameter type as 'string' instead of 'EventData' to get the raw values and avoid JSON deserialization, or 2. Change the queue payload to be valid json. The JSON parser failed: Unable to find a constructor to use for type Microsoft.Azure.EventHubs.EventData. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'Origen', line 1, position 10.
This is the header of the function:
using Microsoft.Azure.EventHubs;
[FunctionName("FunctionTest")]
public static void Run(
[EventHubTrigger("eventHubTest", Connection = "EventHubConnectionString", ConsumerGroup = "%EventHubConsumerGroup%")]
EventData[] myEventHubMessage,
ILogger log)