Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
738 stars 358 forks source link

EventHubTrigger attribute not available with latest packages #1558

Open shaneg83 opened 6 years ago

shaneg83 commented 6 years ago

When using the latest tooling, the EventHubTrigger attribute has a spellcheck line under it and is not available for use using NetStandard 2.0.1

Repro steps

Either create a new EventHubTrigger Function in an Azure Function project,, or open an existing one.

  1. Install Microsoft.NET.Sdk.Functions 1.0.7
  2. Install Microsoft.Azure.WebJobs.ServiceBus v3.0.0-beta4

Expected behavior

The trigger should compile and run as before.

Actual behavior

A spell-check line appears under the EventHubTrigger attribute. The code will not build.

Known workarounds

  1. Uninstall all Function-related packages. 2 Install Microsoft.NET.Sdk.Functions 1.0.2
  2. Install Microsoft.Azure.WebJobs.ServiceBus v2.1.0

The same project will now build.

Related information

Running Visual Studio 2017 Professional, 15.5.6, although the problem occurs in all known releases. The provided workaround is also not satisfactory, as this will effectively break other types of functions including HttpTrigger.

brettsam commented 6 years ago

Are you trying to build a v1 or v2 Function app? For v2, the EventHubTrigger has been broken out into its own package: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs/3.0.0-beta4

shaneg83 commented 6 years ago

Hi Brett,

Thank you for the response. I was working on a V2 application. Since your note, I managed to get everything ported using the suggested library. For anyone else stumbling across this, the working package list looks like this:

  1. Microsoft.Azure.WebJobs v3.0.0b4
  2. Microsoft.Azure.WebJobs.Extensions v3.0.0b4
  3. Microsoft.Azure.WebJobs.ServiceBus v3.0.0b4
  4. Microsoft.Azure.WebJobs.Extensions.EventHub v3.0.0b4
  5. Microsoft.NET.Sdk.Functions v1.0.8
  6. NetStandard.Library v2.0.1

I understand all this is pre-release, but the new tooling introduces some breaking changes (no IQueryable binding) which were easy enough to work around, but also some concerning regressions. The most troubling is that as of now, function.json needs to be manually changed for EventHub triggers to rename the “path” key to “eventHubName” or it will not work at all. Also, the VS extension does not show anything but a few basic triggers (HttpTrigger,TimerTrigger,QueueTrigger,BlobTrigger,Durable Functions Orchestration). The only way to the others to return is to downgrade Azure Functions and Web Jobs Tools from 15.0.40108.0 to 15.0.31106.0. The upshot is you can’t even create a new Event Hub Trigger function as things currently stand. Hopefully these get resolved by RTM!

From: Brett Samblanet [mailto:notifications@github.com] Sent: Friday, February 16, 2018 2:44 PM To: Azure/azure-webjobs-sdk azure-webjobs-sdk@noreply.github.com Cc: shaneg83 research@latticeworx.net; Author author@noreply.github.com Subject: Re: [Azure/azure-webjobs-sdk] EventHubTrigger attribute not available with latest packages (#1558)

Are you trying to build a v1 or v2 Function app? For v2, the EventHubTrigger has been broken out into its own package: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs/3.0.0-beta4

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-webjobs-sdk/issues/1558#issuecomment-366353072 , or mute the thread https://github.com/notifications/unsubscribe-auth/AikiJW6nzestwZ83xDQziV418u3kkG7iks5tVeiVgaJpZM4R9qPO . https://github.com/notifications/beacon/AikiJcAOsEpmTLhX3legV5kQ7xeFgCDqks5tVeiVgaJpZM4R9qPO.gif

deepakkumpala commented 5 years ago

EventHubTrigger is still issue in version 2

gabrieljoelc commented 4 years ago

For other googlers who find themselves on this GH issue trying to figure out which repo the event hub trigger source code is in, it is here.