Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 439 forks source link

Azure IoT Hub Trigger #413

Open christopheranderson opened 8 years ago

christopheranderson commented 8 years ago

From @wmmihaa in azure-iot-sdks - https://github.com/Azure/azure-iot-sdks/issues/586

I know this question is not directly related to the SDK, but does anyone know if there are any plans on offering an AzureIoTHubTrigger function?

This is a new feature add. We have a few things we need to do to support IoT Hub, but we could potentially "map" the EventHub trigger to the IoT Hub event stream, since they are compatible, we just need UX/errors/etc.

I was thinking we'd start breaking down the work required for this support in June. Should triage this to next?

wmmihaa commented 8 years ago

@christopheranderson Let me know if there is anything I can do to help or test

christopheranderson commented 8 years ago

@colbytresness is currently working on specing this

wmmihaa commented 8 years ago

Any news on this @christopheranderson ?

christopheranderson commented 8 years ago

It will probably be on hold for a bit while we wrap up existing work. We've got to decide if we want to build it, or if we want to wrap up our extensiblility story/docs and ask IoT Hub themselves to build it with us.

1N50MN14 commented 7 years ago

@christopheranderson We have a relatively large deployment that we are moving from AWS Lambda to Azure Functions, it depend heavily on IoT Hub Triggers. Whereas AWS has supported this feature for a while now I see this issue has been open for almost half a year. Do you have any concrete plans to implement support for IoT Hub triggers at all?

Not to push, I'm asking only because your feedback would help us evaluate our options.

Thanks

tedvanderveen commented 7 years ago

What are the current options for Azure IoT Hub Trigger Functions? Setup routing to Service Bus and create Function for that @christopheranderson ?

habibcs commented 7 years ago

I found some relevant information here: https://azure.microsoft.com/en-us/blog/azure-iot-gateway-sdk-integrates-support-for-azure-functions/ says: Azure IoT Gateway SDK integrates support for Azure Functions - meaning we can have a trigger from IoT Hub to Azure Function without the need of middle man (i.e. Event Hub).

For me, I want the Azure Function to Azure IoT hub so that IoT Hub send the message to my IoT gateway device. I cannot use Notification Hub for this purpose as my gateway is a C language based tiny device. Do we have this feature now as well?

vjrantal commented 7 years ago

@1N50MN14 @tedvanderveen @habibcs IoT Hub exposes an Event Hub -compatible endpoint that can be used as a trigger for Functions. This blog post provides guidance on how to do that and I have a sample here that stores data coming to an IoT Hub to a PostgreSQL database using a Node.js app running in Azure Functions.

1N50MN14 commented 7 years ago

@vjrantal This issue is obviously old, I have since figured out how to integrate IoT Hub with Azure Functions, but unfortunately the lack of CORS support is a show stopper see this issue https://github.com/Azure/azure-webjobs-sdk-script/issues/1139 - pay attention to how many thumbs up it has.

At this point I've given up on IoT Hub all together and went back to AWS IoT.

awong1900 commented 7 years ago

@vjrantal Yes, but now can not fill in the "Event Hub connection". image

vjrantal commented 7 years ago

@awong1900 That does not look right since you should be able to see something like below to create a new connection and start using it:

screen shot 2017-06-02 at 12 01 51

If you still have this issue, I suggest reporting it at https://github.com/Azure/azure-functions-ux/issues. I can also see there is some ongoing work in this area https://github.com/Azure/azure-functions-ux/issues/1414 so please check that one as well.

awong1900 commented 7 years ago

Yes, that thread is exactly description.