Closed MacMcDell closed 2 years ago
I found this link with exactly the same issues as I am having, however the resolution is not working for me. Replacing the EventHubName with whatever is in EntityPath ... in my case is application name iothb-ingress-pr resulted in the function working but the events are still all empty of any content. Running the same app as 3.1 give s me the messages. System Properties is just a single kv of ContentType , "application-json".
I was able to figure out from another ticket to change my inputs body from EventData[] to Byte[][] or string[] . This has enabled me to obtain the payloads I need to continue working BUT it means I have lost all features of EventData . I feel like either something is very wrong here or this needs to be better documented somehow.
Binding to the EventData
type is not yet supported in the isolated model. But you can bind the messages to string array or an array of POCO (which has a matching structure of the message payload sent to the event hub).
Obtaining the meta properties of the message is also supported. Please refer the event hub trigger example in our samples. Let us know if you run into any issues.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
I have a legacy/older running 3.1 azure function IOThubTrigger running using .net 3.1. Trying to upgrade the project to .net 6 Isolated. Running into so many issues with reading the EventData objects.
Old Function Signature which is working 100%
When the function executes from the listener I get the following payload:
.Net6 Isolated 4.x azure function
The Problem:
Trying to run the application results in all EventData being empty. I subscribe to the same IOTHub endpoint using Microsoft.Azure.Functions.Worker.Extenstions.EventHubs V4.3 and the eventData is completely empty. I get the message batches but cannot read or parse them at all as it seems they are empty upon arrival??!
Attempted resolutions:
Upgraded Microsoft.Azure.Functions.Worker.Extenstions.EventHubs to V5.1.0 Result: Exception is thrown on the Event Hub-compatible endpoint (inlcudes EntityPath), with the following message
Azure.Messaging.EventHubs: The path to an Event Hub may be specified as part of the connection string or as a separate value, but not both. Please verify that your connection string does not have the
EntityPathtoken if you are passing an explicit Event Hub name. (Parameter 'connectionString').
Omitting EntityPath from the connection string results in
'The messaging entity 'sb://path.servicebus.windows.net/messages/events' could not be found. To know more visit https://aka.ms/sbResourceMgrExceptions. (messages/events)'
There does not appear to be any documentation on how to use a different connection string since Connection is still the param in the Ctor of EventHubTrigger
Attempts at using Shared Access Policy for IOTHubOwner also fail along similar lines.
Service:IoTHubConnectionString: "HostName={hostname};SharedAccessKeyName={};SharedAccessKey={}" Error: Azure.Messaging.EventHubs: The connection string used for an Event Hub client must specify the Event Hubs namespace host, and either a Shared Access Key (both the name and value) or Shared Access Signature to be v alid. The path to an Event Hub must be included in the connection string or specified separately. (Parameter 'connectionString')..... :(
SETUP
.csproj
I am at a complete loss at this point on how to get my currently running event into my isolated .net6 project. I can't find any EventHubTrigger code samples that refer to dropping EntityPath from the connection string (Note this only breaks in V5.1.0 of Extensions.EventHubs)
Any advice or help would be greatly appreciated.