Upgrade of azure-iothub to 1.7.5 causes error in function node

#1

The following minimal code works fine in a function node when using azure-iothub@1.7.4 but upgrading to 1.7.5 results in the following error:

"TypeError: Callback has to be a Function"

This code is minimal and almost straight out examples provided and does not seem to have this issue outside of node-red.

I am running on the following:

Node-RED version: v0.19.4
Node.js version: v8.11.1


var iothub = global.get('azure-iothub');

var connectionString = 'HostName=myhub.azure-devices.net;SharedAccessKeyName=nodered;SharedAccessKey=xxxx';


var device = 
    {
        deviceId: 'test' 
    };
 
var registry = iothub.Registry.fromConnectionString(connectionString);

registry.get(device.deviceId, function(err, deviceInfo, res) { 
    });
#2

This has been fixed in the azure-iothub library and should be in the next release(1.8.2?).

#3

Is there a reason you are not using the azure IOT hub nodes rather than using a function?

#4

The node requires a connection string for each device which is impractical for potentially thousands of devices. Furthermore, I am registering devices as they come online so I need to first check if already registered and register in IoT Hub if not.

#5

Can I get some more details on what exactly you are using and how you are getting it into node-red? I see you are using global somehow... I have not used global before..

#6

I think there are two different IOTHub nodes out there. One that requires a string for each node and one that requires it to be passed with the payload.