I wonder why my webjob is not able to execute method ProcessQueueMessage
in Functions.cs
after find message in queue?
Functions.cs
public class Functions
{
public static void ProcessQueueMessage([QueueTrigger("testqueue")] string logMessage, TextWriter logger)
{
logger.WriteLine(logMessage);
}
I run this webjob it shows following in console.
Found the following functions:
ProcessQueueMessage
Job host started
The problem is the Debugger is not hit when there is any messages added into testqueue
.
I already did this last time, and it worked. What did I miss? I have not hosted my webjob on Azure.
I just tried running similar code to yours and it worked fine. The code I ran is a freshly created "Azure WebJob" project in Visual Studio 2015 with Azure SDK 2.7.1.
However, I made a few observations when trying it out.
Therefor, verify that the queue you are using ("testqueue") actually exists and is not misspelled. If it doesn't exist, restart the application.
In my tests, it didn't pick up new queue messages before I restarted the application, after creating the queue.
For reference, you can find my code here https://github.com/kimpihlstrom/azure/tree/master/Azure.Webjob.SDK.MessageProcessor. Just updated the AzureWebJobsDashboard and AzureWebJobsStorage with some real values.
The storage account name and key can be found from Azure management portal. Navigate to the storage account and press the "Manage Access Keys" button at the bottom of the screen.