Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No job functions found in Azure Webjobs

Trying to get Azure Webjobs to react to incoming Service Bus event, Im running this by hitting F5. Im getting the error at startup.

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).

My functions-class look like this:

   public class Functions
    {
        // This function will get triggered/executed when a new message is written 
        // on an Azure Queue called queue.
        public static void ProcessQueueMessage([ServiceBusTrigger("test-from-dynamics-queue")] BrokeredMessage message, TextWriter log)
        {
            log.WriteLine(message);
        }
    }

I have every class and method set to public

I am calling config.UseServiceBus(); in my program.cs file

Im using Microsoft.Azure.WebJobs v 1.1.2

((Im not entirely sure I have written the correct AzureWebJobsDashboard- and AzureWebJobsStorage-connectionstrings, I took them from my only Azure storage-settings in Azure portal. If that might be the problem, where should I get them ))

like image 800
Cowborg Avatar asked Jan 26 '17 23:01

Cowborg


Video Answer


1 Answers

According to your mentioned error, it seems that you miss parameter config for ininitializing JobHost. If it is that case, please use the following code.

JobHost  host = new JobHost(config)

More detail info about how to use Azure Service Bus with the WebJobs SDK please refer to the document.The following is the sample code from document.

public class Program
{
   public static void Main()
   {
      JobHostConfiguration config = new JobHostConfiguration();
      config.UseServiceBus();
      JobHost host = new JobHost(config);
      host.RunAndBlock();
   }
}
like image 140
Tom Sun - MSFT Avatar answered Sep 23 '22 16:09

Tom Sun - MSFT