Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Azure WebJob Issue after package update – Host is not running

It took me a while to get the solution for this problem and Google gave me nothing when I search the error (warning) message so I thought its worth to share it here with you all.

Problem

Error Message: Host is not running; requests will be queued but not execute until the host is started

Screenshot

Solution

It happened because of the breaking changes in Beta 0.5 version. Azure used to have the problem with same name in different region due to their caching. I beleive that some parts of Azure tools like ‘Visual Studio’s publish dialog to azure’ and ‘SCM’ were not built to support the “same name/multiple regions” or multiple subscriptions in mind. I reported about “Problem: Issue with multiple Azure subscriptions with same name” before.

The solution for this issue is to make the class and method public. It’s an unusual practice for console programs but it’s how it is and it works.


public class Program {

private static Logger _logger = LogManager.GetCurrentClassLogger();

public static void Main(string[] args) {
_logger.Info("Test Main Started");
var host = new JobHost();
host.RunAndBlock();
_logger.Info("Test Main Ended");
}

public static async Task TestAsync([QueueTrigger("testqueue")] string _) {
_logger.Info("TestAsync Started");
await Task.Delay(30);
_logger.Info("TestAsync Ended");
}
}

And if you toggle the output of your webjob in SCM, you will see this log below. Then you will know that you need to make the class and Methods Public.

[INFO] No functions found. Try making job classes public and methods Public Static.

So, That’s it. Hope it helps saving some of your time.

 



This post first appeared on Michael Sync | Sharing Knowledge, please read the originial post: here

Share the post

Azure WebJob Issue after package update – Host is not running

×

Subscribe to Michael Sync | Sharing Knowledge

Get updates delivered right to your inbox!

Thank you for your subscription

×