Esempio n. 1
0
 public async Task RunAsyncTest()
 {
     // 例外とか起こさずに正常に走るかテスト
     var service = new RecentVoice2DiscordService(
         CloudStorageAccount.DevelopmentStorageAccount,
         ConfigurationManager.AppSettings["TableName"],
         ulong.Parse(ConfigurationManager.AppSettings["DiscordWebhookId"]),
         ConfigurationManager.AppSettings["DiscordWebhookToken"],
         ConfigurationManager.AppSettings["MixiEmail"],
         ConfigurationManager.AppSettings["MixiPassword"],
         new WebProxy(ConfigurationManager.AppSettings["MixiClientProxy"]));
     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}");

            try
            {
                var service = new RecentVoice2DiscordService(
                    GetDefaultStorageAccount(),
                    CloudConfigurationManager.GetSetting("TableName"),
                    ulong.Parse(CloudConfigurationManager.GetSetting("DiscordWebhookId")),
                    CloudConfigurationManager.GetSetting("DiscordWebhookToken"),
                    CloudConfigurationManager.GetSetting("MixiEmail"),
                    CloudConfigurationManager.GetSetting("MixiPassword"),
                    new WebProxy(CloudConfigurationManager.GetSetting("MixiClientProxy")));
                await service.RunAsync(x => log.Info(x));
            }
            catch (Exception e)
            {
                log.Error(e.Message + " " + e.StackTrace, e);
                throw;
            }
        }