Skip to content

Instantly share code, notes, and snippets.

@stephlocke
Created August 22, 2016 14:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephlocke/b6807eb0fafc065df53e4a67c21511fe to your computer and use it in GitHub Desktop.
Save stephlocke/b6807eb0fafc065df53e4a67c21511fe to your computer and use it in GitHub Desktop.
Running Azure Functions in a WebJob
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
namespace blah
{
public class Functions
{
public static void dummyFunction([TimerTrigger("00:00:30")], TraceWriter log){
log.Info("Hey, I worked");
}
}
}
using Microsoft.Azure.WebJobs;
namespace blah
{
// To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976
class Program
{
// Please set the following connection strings in app.config for this WebJob to run:
// AzureWebJobsDashboard and AzureWebJobsStorage
static void Main()
{
JobHostConfiguration config = new JobHostConfiguration();
config.Tracing.ConsoleLevel = TraceLevel.Verbose;
// Registered extension triggers
config.UseTimers();
var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment