Reputation: 23
I am getting issue IoTHubtrigger in azure function, Befor eit was working fine but suddenly it stops to triggered in azure function. Here is my azure function 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 TestIot
{
public static class Function1
{
private static HttpClient client = new HttpClient();
[FunctionName("Function1")]
public static void Run([IoTHubTrigger("messages/events", Connection = "IoTHubEndpoint")]EventData message, TraceWriter log)
{
log.Info($"C# IoT Hub trigger function processed a message: {Encoding.UTF8.GetString(message.GetBytes())}");
}
}
}`
can someone help me with this issue everything i configured in proper way but still not getting message in azure function. If some help me with my issue it would be really appreciated.
I am trying to trigger IoT Hub message in azure function but still not getting any message on azure function ,when i try to send message form simulator device message reached to IOTHUB but not triggering in azure function.
Upvotes: 0
Views: 135
Reputation: 3639
private static HttpClient client = new HttpClient(); [FunctionName("Function1")] public static void Run([IoTHubTrigger(“messages/events”, Connection = “IoTHubEndpoint”)]EventData message, TraceWriter log) { log.Info($“C# IoT Hub trigger function processed a message: {Encoding.UTF8.GetString(message.GetBytes())}”); }
In Azure Portal:
Upvotes: 0