3

I am new to web-jobs so I need some help to make this clear. I have web job.

public static class Functions
    {
//.....
    public static async Task RevalidateImport(
        [QueueTrigger(QueueName.StorageRevalidate)] RevalidateImportCommand command,
        TextWriter logWriter)
    {
        await logWriter.WriteLineAsync("Start");
        try
        {
            //Do something
        }
        catch (Exception ex)
        {
            //Log
        }
        await logWriter.WriteLineAsync("End");
    }
//.....
}

Is it possible to have non-static class, with non static web jobs? I want have unit testable class.Also I want inject some stuff in this class.

Raskolnikov
  • 3,791
  • 9
  • 43
  • 88
  • Look at this question: [Dependency injection using Azure WebJobs SDK?](http://stackoverflow.com/questions/30328775/dependency-injection-using-azure-webjobs-sdk) – Thomas Dec 08 '15 at 04:40

1 Answers1

1

I found solution. I looks simple.
Azure WebJobs dependency injection with SimpleInjector.

Community
  • 1
  • 1
Raskolnikov
  • 3,791
  • 9
  • 43
  • 88