Look like you are passing the storage connection string instead of the hub connection string
Here you need to add the real hub connection string:
"EventHubConnectionString":"Endpoint={endpoint};SharedAccessKeyName={keyName};SharedAccessKey={accessKey};EntityPath={entityPath}",]
the azure hub (not the hub namespace) can be found here:
https://video2.skills-academy.com/en-us/azure/event-hubs/event-hubs-get-connection-string
under #1, replace "AzureWebJobsStorage" with "EventHubConnectionString"
you may need to remove the last bit of the connection string (EntityPath={entityPath}
The value for that will be in #2
It should look like:
@EventHubTrigger(name = "message", eventHubName = "custom001",
connection = "EventHubConnectionString",
try running with that. make sure "EventHubConnectionString" has the real connection string values.
I use C# and the latest libraries now expect the connection string to don't include the entity path
case you get some error asking to remove the entity path from connection string, change this:
"EventHubConnectionString":"Endpoint={endpoint};SharedAccessKeyName={keyName};SharedAccessKey={accessKey};EntityPath={entityPath}"
to this:
"EventHubConnectionString":"Endpoint={endpoint};SharedAccessKeyName={keyName};SharedAccessKey={accessKey};"
and make sure the value for EntityPath={entityPath} (that is the hub name) is added to the "eventhubname" parameter
To run/test in Visual Studio, add the real connection strings to your local.settings.json:
to run in the cloud, you can manually add. if you add to local.settings.json and deploy with Visual studio, most of the time it will create that for you:
Please don't forget to click on "Accept Answer" or the vote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer.