Exemplo n.º 1
0
        public static async Task Run(
            [TimerTrigger("0 0 20 * * *")] TimerInfo myTimer,
            ILogger logger,
            [Inject] IPostDiary2MixiService postDiary2MixiService,
            [Inject] IConfigProvider configProvider
            )
        {
            var config = configProvider.GetConfig();

            if (config["IsLocal"] == "true")
            {
                return;
            }
            await postDiary2MixiService.PostDiary();
        }
Exemplo n.º 2
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "PostDiary2MixiTest")] HttpRequest req,
            ILogger logger,
            [Inject] IPostDiary2MixiService postDiary2MixiService,
            [Inject] IConfigProvider configProvider
            )
        {
            var config = configProvider.GetConfig();

            if (config["IsLocal"] != "true")
            {
                return(new BadRequestResult());
            }

            await postDiary2MixiService.PostDiary();

            return(new OkResult());
        }