title: Azure Functions - IoTHubTrigger But It will not trigger
body: <p>I create a azure function with IoT Hub trigger. As an example I use this  <a href="https://stackoverflow.com/questions/52743156/azure-functions-how-to-set-up-iothubtrigger-for-my-iothub-messages">Azure Functions - how to set up IoTHubTrigger for my IoTHub messages?</a></p>
  
  <p>Function1.cs</p>
  
  <pre><code>using IoTHubTrigger = Microsoft.Azure.WebJobs.ServiceBus.EventHubTriggerAttribute;
  
  using Microsoft.Azure.WebJobs;
  using Microsoft.Azure.WebJobs.Host;
  using Microsoft.ServiceBus.Messaging;
  using System.Text;
  using System.Net.Http;
  
  namespace LogTheIoTHubMessage
  {
      public static class Function1
      {
          private static HttpClient client = new HttpClient();
  
          [FunctionName("Function1")]
          public static void Run([IoTHubTrigger("messages/events", Connection = "ConnectionString")]EventData message, TraceWriter log)
          {
              log.Info($"C# IoT Hub trigger function processed a message: {Encoding.UTF8.GetString(message.GetBytes())}");
          }
      }
  }
  </code></pre>
  
  <p>local.settings.json</p>
  
  <pre><code>{
      "IsEncrypted": false,
    "Values": {
      "AzureWebJobsStorage": "UseDevelopmentStorage=true",
      "AzureWebJobsDashboard": "UseDevelopmentStorage=true",
      "ConnectionString": "HostName=AAA.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=YYYYYY"
    }
  }
  </code></pre>
  
  <p>But when I test the function it will start but the trigger will not trigger. For testing I use </p>
  
  <blockquote>
    <p>C:\Program Files\mosquitto>mosquitto_pub -d -h AAA.azure-devices.net
    -i TestRaspberryPi -u "AAA.azure-devices.net/TestRaspberryPi" -P "SharedAccessSignature sr=YYY" -m "noch ein test" -t
    "devices/TestRaspberryPi/messages/events/readpipe/" --cafile
    "c:\Projects\azureiot.pem" -p 8883 -V mqttv311</p>
    
    <p>Client TestRaspberryPi sending CONNECT Client TestRaspberryPi received
    CONNACK (0) Client TestRaspberryPi sending PUBLISH (d0, q0, r0, m1,
    'devices/TestRaspberryPi/messages/events/readpipe/', ... (13 bytes))
    Client TestRaspberryPi sending DISCONNECT</p>
  </blockquote>