Open tanwang99 opened 6 years ago
Can you try step 2 of the instructions here. More than just VS you need the latest version of the Azure Functions tools to have the latest templates
And make sure to update your project / start new. After installing the update I couldn't see the template, created a new project and then it was visible.
tanwang99, did you managed to fix it? I have the same issue. VS 15.7.4, Tools of version 15.0.40608.0. i can't find Azure Function in template list at all. In fact there is no Azure-connected templates when trying to add new item to the project.
@belurd do you see Functions when you create a new project? Wondering if you have the right VS packages installed (the cloud workload)
Yes. Create a project works fine.
Could it be something that broke the template usage? I newly created project I got warning on ...Sdk.Functions with text "Not available at this source".
Very likely. The SDK is what signals to VS to expose the function templates I believe. Can you copy the error you see? And confirm you have the nuget gallery in your nuget sources
I saw this issue too and was able to work around it. When you are creating the new Azure Functions project, look for a spinning wheel in the bottom left corner saying something like "making sure templates are up to date." I had to wait for that to stop spinning and refresh (took a few minutes), and then when I went to add a new function to the project, the IoT Hub trigger was there.
Thanks for help. I have fixed nuget packages now and can see Azure function in the templates list.
The new problem for me is that in the "New Azure Function" list there is no "IoT Hub Trigger" template:
Microsoft.NET.Sdk.Functions version is 1.0.14 Azure Functions and Web Job Tools version is 15.0.40608.0
What will differ if I use Event Hub Trigger template?
Event Triggers works fine. Just make sure you have the right path / event Hub name which is by default like “events/messages” — same as IoT Hub trigger template in README
Thank you. I have tried this way too.
What I got at the end:
public static class ClickFunction
{
[FunctionName("ClickFunction")]
public static void Run([EventHubTrigger("hubcompatiblename", Connection = "IoTHubConnectionString")]string myEventHubMessage, TraceWriter log)
{
log.Info($"C# Event Hub trigger function processed a message: {myEventHubMessage}");
}
}
Packages added are Microsoft.SDK.Net.Functions v,1.0.13 and Microsoft.Azure.WebJobs.Extensions.EventHubs v.3.0.0-beta5.
When running debug getting this errors: As I found in issue tracker the Java error is nothing to be worry about. But those PartitionsIds...
Is there anywhere on GitHub the code example from KeyNote? Have you shared it, @jeffhollan ?
Again, thank you for your time and help. I got the Texxmo button at https://globaldevopsbootcamp.com/ event and really want to make it work.
By default with IoT Hub the name is “messages/events” - try using that and see if it works
Thanks @jeffhollan . I will check it tomorrow.
At the end I fixed function at the Azure portal. Button click tweets now a time when it was clicked.
VS 2017 version 15.7.1