Пример #1
0
        public async Task <IActionResult> SendBlockKitFormat(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
            [Slack(IncomingWebhookUrl = "%Slack:IncomingWebhookUrl%")] IAsyncCollector <string> asyncCollector,
            ILogger log)
        {
            var title       = "*#28 App Service サイコーです!*";
            var description = "xxx で更新がありました。";
            var eventName   = "Added Timeline";
            var updater     = "GEEK: 鈴木イチロー ";
            var detail      = "WebAppsにデプロイしたアプリケーションにブラウザからアクセスした際に HTTP応答431 Request Header Fields Too Large が返され、アクセスが失敗する場合があります。 対処方法を教えてください。後のコメントで、違う端末から次のAPIにアクセスした際のHTTPヘッダを記載します...";


            var buttonLink = @"http://docs.microsoft.com/";

            var payload = SlackMessageHelper.CreateEventNotificationMessageSample(
                title,
                "View More",
                buttonLink,
                description,
                eventName,
                updater,
                detail
                );

            await asyncCollector.AddAsync(payload);

            return(new OkObjectResult("Hello"));
        }
        public void Test1()
        {
            var title       = "*#14 How to use Worker Services?*";
            var description = "xxx で更新がありました。";
            var eventName   = "Added Timeline";
            var updater     = "鈴木イチロー";
            var detail      = "xxx の動作はxxx から起動します...";

            var image = @"https://www.techielass.com/wp-content/uploads/2019/09/Microsoft-Azure-Cloud-Advocate-300x300.jpg";


            var message = SlackMessageHelper.CreateEventNotificationMessageSample(
                title,
                "View More",
                image,
                description,
                eventName,
                updater,
                detail
                );

            Console.WriteLine();
        }