The "How to use Azure Service Bus with the WebJobs SDK" Azure Documentation article shows the usage of [ServiceBusTrigger]
attribute for integrating a WebJob and Azure Service Bus Topic messages. However, using the default Azure WebJobs project template in Visual Studio 2015, the reference to ServiceBusTrigger causes the following compile time exception:
The type or namespace name 'ServiceBusTriggger' could not be found (are you missing a using directive or an assembly reference?)
The problem at hand is the Microsoft.Azure.WebJobs package from Nuget doesn't contain the ServiceBusTriggerAttribute class.
Is there a Nuget package that can be added that will include this much needed class?
I have tried including the WindowsAzure.ServiceBus package from Nuget, but that doesn't contain it either.
Without the ServiceBusTriggerAttribute I am unable to get this WebJob connected to consume messages from an Azure Service Bus Topic. Any help would be greatly appreciated! Thanks!
Microsoft. Azure. Web Jobs Attribute used to bind a parameter to a ServiceBus Queue message, causing the function to run when a message is enqueued. Microsoft.Azure.WebJobs.ConnectionProviderAttribute Microsoft.Azure.WebJobs.Description.BindingAttribute Attribute Usage Attribute Initializes a new instance of the ServiceBusTriggerAttribute class.
Referencing external assemblies in Azure Functions 1 Adding an external assembly. Let’s first create a new assembly. I am using a very complex calculation to determine the... 2 Referencing the assembly. Now for the hard part At least for me it was. I couldn’t find the right commando/keyword,... 3 More information on references. More ...
Add the assembly to the BIN directory using KUDU Include the assembly and code the Azure Function to use it There is nothing overly exciting about this part, ok maybe it is exciting after all, create the Azure Function, you know the deal. I did create a Custom function, I.e. not a Timer, Data processing or Webhook + API one.
I have previously blogged about Azure Functions and the potential of these small, stand-alone functions. It is a welcome addition to the Microsoft’s micro services vision. Function Apps are about the smallest amount of work you can do and it’s all easily exposed through an API.
You need to include the Microsoft.Azure.WebJobs.Extensions.ServiceBus NuGet package as mentioned in the Prereq section of this article https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-service-bus/#prerequisites
This answer is correct for Functions 1.x, but if you are using Functions 2.x, then you need to install Microsoft.Azure.WebJobs.Extensions.ServiceBus:
Install-Package Microsoft.Azure.WebJobs.Extensions.ServiceBus
Here is the Microsoft documentation Azure Service Bus bindings for Azure Functions.
Also, make sure you reference the latest package and update any dependent packages.
The Microsoft.Azure.WebJobs.ServiceBus package from Nuget contains the ServiceBusTriggerAttribute
class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With