Azure functions Azure功能与IoT集线器触发器获取发送设备

Azure functions Azure功能与IoT集线器触发器获取发送设备,azure-functions,azure-iot-hub,Azure Functions,Azure Iot Hub,我用IoT集线器触发器创建了一个函数 log.Info($“C#IoT Hub trigger函数处理了一条消息:{Encoding.UTF8.GetString(message.GetBytes())}”); 函数仅记录消息。但是我怎样才能得到发送信息的设备呢 问候 Stefan查看以下示例: 使用系统; 公共静态无效运行(字符串MyIoTubMessage、IDictionary属性、IDictionary系统属性、TraceWriter日志) { log.Info($“C#IoT Hub

我用IoT集线器触发器创建了一个函数

log.Info($“C#IoT Hub trigger函数处理了一条消息:{Encoding.UTF8.GetString(message.GetBytes())}”);
函数仅记录消息。但是我怎样才能得到发送信息的设备呢

问候
Stefan查看以下示例:

使用系统;
公共静态无效运行(字符串MyIoTubMessage、IDictionary属性、IDictionary系统属性、TraceWriter日志)
{
log.Info($“C#IoT Hub触发器函数处理了一条消息:\n\t{myIoTHubMessage}”);
log.Info($“DeviceId={systemproperties[“iothub连接设备id”]});
log.Info($”\nSystemProperties:\n\t{string.Join(“\n\t”,systemproperties.Select(i=>$”{i.Key}={i.Value}”))});
log.Info($”\n属性:\n\t{string.Join(“\n\t”,properties.Select(i=>$”{i.Key}={i.Value}”))});
}