Exemplo n.º 1
0
 public async Task TestMethod1Async()
 {
     var service = new AbiNotifierService(
         CloudStorageAccount.DevelopmentStorageAccount,
         ConfigurationManager.AppSettings["TableName"],
         ulong.Parse(ConfigurationManager.AppSettings["DiscordWebhookId"]),
         ConfigurationManager.AppSettings["DiscordWebhookToken"],
         ConfigurationManager.AppSettings["YouTubeApiKey"]);
     await service.RunAsync();
 }
        public static async Task Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, TraceWriter log)
        {
            log.Info($"C# Timer trigger function executed at: {DateTime.Now}");

            var storageAccount = CloudStorageAccountUtility.GetDefaultStorageAccount();

            var discordWebhookId    = ulong.Parse(CloudConfigurationManager.GetSetting("DiscordWebhookId"));
            var discordWebhookToken = CloudConfigurationManager.GetSetting("DiscordWebhookToken");
            var youtubeApiKey       = CloudConfigurationManager.GetSetting("YouTubeApiKey");

            var service = new AbiNotifierService(
                storageAccount,
                TableName,
                discordWebhookId,
                discordWebhookToken,
                youtubeApiKey);

            await service.RunAsync();
        }