Mostafa
Mostafa

Reputation: 3302

Running Azure functions with IoT Hub trigger

I am trying to run an azure function locally in Visual Studio 2017 preview with latest tooling for azure functions. i want to know how to pull function.json as my function works on the azure portal but not locally in VS2017.

Looking forward on how to set iot hub connection endpoint settings in local.settings.json file.

Upvotes: 0

Views: 427

Answers (1)

Mikhail Shilkov
Mikhail Shilkov

Reputation: 35154

In VS2017 tooling function.json file isn't created manually anymore. Instead, it's being generated at publish time from attributes that you put on your function parameters. In your case you will use EventHubTrigger attribute, see several examples in wiki.

Having an existing function.json, you should copy each property-value pair from the binding to the corresponding property of EventHubTrigger attribute. There's not automated way to do that.

local.settings.json is the container to put your app settings while running function locally from VS. They are just key-value pairs, go copy your settings from the portal if you have them there already. This file has no effect on deployment to Azure.

Upvotes: 3

Related Questions