Skip to content

Instantly share code, notes, and snippets.

@asizikov
Created July 10, 2020 09:28
Show Gist options
  • Save asizikov/3528207d6fba89f70257278c68fe6ade to your computer and use it in GitHub Desktop.
Save asizikov/3528207d6fba89f70257278c68fe6ade to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using DockerizedFunc.Dependency;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace DockerizedFunc.FunctionApp
{
public class ConsoleWriter
{
private readonly IAsyncGreeter _asyncGreeter;
public ConsoleWriter(IAsyncGreeter asyncGreeter)
{
_asyncGreeter = asyncGreeter;
}
[FunctionName("ConsoleWriter")]
public async Task RunAsync(
[TimerTrigger("20 * * * * *")] TimerInfo myTimer,
ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.UtcNow}");
await _asyncGreeter.SayHiAsync();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment