Hi, I tried your code on a v3 function and that worked for me.
Looking on your error looks like your connection string is not correct.
If you copy from here
Notice a trigger need a path to a hub. that means you need to replace the "mystring" in ("IoTHubEndpoint": "mystring") with the whole value of the endpoint
that will look like this (don't forget the EntityPath). Look like your error is complaining about the EntityPath bit:
Endpoint=sb://iothub-ns-xxxx-17640743-b3xxx6c.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=oxxxyU2B0Hcxm9d9aS5EbkxxxXM8/8teIGuro=;EntityPath=myotakl990
That error is common for sender code. if you add the full connection string including the path you should see that error . for sender with 2 params, one is the entity path and the other is the conn string without the path.