-
Notifications
You must be signed in to change notification settings - Fork 1
/
PollFreshDeskTickets_Timer.cs
35 lines (30 loc) · 1.25 KB
/
PollFreshDeskTickets_Timer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Threading.Tasks;
using BotFramework.FreshDeskChannel.Shared;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace BotFramework.FreshDeskChannel
{
public static class PollFreshDeskTickets_Timer
{
[FunctionName("PollFreshDeskTickets_Timer")]
public static async Task RunAsync([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ExecutionContext context, ILogger log)
{
try
{
//Read config values
var config = new ConfigurationBuilder()
.SetBasePath(context.FunctionAppDirectory)
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true) // <- This gives you access to your application settings in your local development environment
.AddEnvironmentVariables() // <- This is what actually gets you the application settings in Azure
.Build();
await CustomChannelLogic.ProcessChannel(config, log);
}
catch (Exception ex)
{
log.LogError("Exception occurred in processing Azure Function: {1}", ex);
}
}
}
}