Let's take a look at the following steps for implementing the average result function:
- To create a new scheduled function, right-click on the project, and navigate to Add -> New Item -> Azure Function. Select the following options:
- Type: Timer Trigger
- Name: AverageResults
- Schedule: "0 0 * * * *"--as explained in the previous section, this will trigger the function every hour on top of the hour
The generated function code in AverageResults.cs will be as follows:
[FunctionName("AverageResults")] public static async Task Run([TimerTrigger("0 0 * * * *")]TimerInfo myTimer, TraceWriter log) { log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); }
When you compile the function, the ...