Created
August 22, 2016 14:56
-
-
Save stephlocke/b6807eb0fafc065df53e4a67c21511fe to your computer and use it in GitHub Desktop.
Running Azure Functions in a WebJob
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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