static DeviceClient _deviceClient; _deviceClient = DeviceClient.CreateFromConnectionString(<IoTHubURI>, TransportType.Http1); public void SendMessage(IDictionary<string, object> dictionary) { Microsoft.Azure.Devices.Client.Message message = new Microsoft.Azure.Devices.Client.Message(); try { foreach (var r in dictionary) { message.Properties[r.Key] = r.Value.ToString(); } _deviceClient.SendEventAsync(message); } catch (Exception ex) { Debug.WriteLine(ex.Message); } }