I want to use EventData class to read event message from iot hub but I keep getting error below regarding adding the namespace Microsoft.ServiceBus.Messaging
Appreciate any help to identify what could be wrong?
#r "Newtonsoft.Json"
#r "Microsoft.ServiceBus"
using System;
using Newtonsoft.Json.Linq;
using Microsoft.ServiceBus.Messaging;
public static void Run(EventData myIoTHubMessage, out object outDocument, ILogger log)
{
dynamic msg = JObject.Parse(myIoTHubMessage);
outDocument = new {msg};
log.LogInformation($"C# IoT Hub trigger function processed a message: {myIoTHubMessage}");
}
2020-06-06T23:05:31Z [Error] Function compilation error 2020-06-06T23:05:31Z [Error] run.csx(8,24): error CS0246: The type or namespace name 'EventData' could not be found (are you missing a using directive or an assembly reference?) 2020-06-06T23:05:31Z [Error] run.csx(4,17): error CS0234: The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 2020-06-06T23:05:31Z [Error] run.csx(2,1): error CS0006: Metadata file 'Microsoft.ServiceBus' could not be found 2020-06-06T23:05:31Z [Warning] You may be referencing NuGet packages incorrectly. Learn more: https://go.microsoft.com/fwlink/?linkid=2091419