azure-webjobs Azure Webjobs SDK JobHost

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

The Azure Webjobs SDK is a framework distributed as a Nuget package aimed at helping you define Functions that are run by Triggers and use Bindings to other Azure services (like Azure Storage and Service Bus) in a declarative fashion.

The SDK uses a JobHost to coordinate your coded Functions. In a tipical scenario, your Webjob is a Console Application that initializes the JobHost this way:

class Program
{
    static void Main()
    {
        JobHostConfiguration config = new JobHostConfiguration();
        config.StorageConnectionString = "Your_Azure_Storage_ConnectionString";
        config.DashboardConnectionString = "Your_Azure_Storage_ConnectionString";
        JobHost host = new JobHost(config);
        host.RunAndBlock();
    }
}

The JobHostConfiguration lets you personalize more settings for different triggers:

config.Queues.BatchSize = 8;
config.Queues.MaxDequeueCount = 4;
config.Queues.MaxPollingInterval = TimeSpan.FromSeconds(15);
config.JobActivator = new MyCustomJobActivator();


Got any azure-webjobs Question?