I am currently having troubles with connecting my function trigger to an IoT-Hub, overnight it broke somehow. Function version 4. Node.js version 14 LTS.
First I got an error saying I have to use web.jobs version 4.3.0, I changed the host.json to include this
Then it has started giving me a runtime error which I don't know how to fix, the error:
I defined connection string in the portal which has the format
"Endpoint=sb//{iothub-ns-"somename"-"somenumber".servicebus.windows.net/}; SharedAccessKeyName={NameOfAccessKey};SharedAccessKey={TheKey};EntityPath={Name};
Lastly I tried removing the EntityPath which removed the error but then nothing came to the function anymore
Edit: I got it fixed by changing function version to 3 and reverting the original Host.json to be "version": "[2.*, 3.0.0)".
I have no idea how the runtime version got changed, even when I made new functions they would also get this error. It is probably just something I have done within my workspace that is causing this.