CurlyBytes / teams-incident-status-page-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reindeer Guidance & Delivery System - Status Updates

Santa and his reindeer get almost all the credit when it comes to delivering gifts on Christmas Eve.

But if it weren't for the elves on the Engineering & IT teams building, operating, and supporting the systems that help make all that "magic" happen, there would be a lot of dissapointed children around the world on Christmas day.

When then there's a problem with the systems that help Santa and his reindeer find and deliver gifts to children all around the world, elves are immediately dispatched to diagnose and restore service.

During those tense disruptions, it's important everyone stay "in the know" about:

  • Who is affected
  • What is being about it
  • When we should expect further updates

Challenge

Build a method to communicate the current status and running log of service disruptions to a global audience.

Solution

Santa's globally distributed team of helpers can use their mobile phones to immediately update the rest of the team the status of service disruptions via a web page that refreshes without user interaction. Additionally, it will provide a running log of each update received over time for greater context and awareness.

NOTE: Click the image below (or here) to see the final result

Tech Used

The brains behind this solution is an Azure Function (running Node.js) that is triggered via outgoing webhook (from Microsoft Teams). The function modifies an index.html file stored in a "web server" served from a serverless SMB file share in Azure Storage.

Users can open, update, and close "status updates" by invoking them from within a chat channel.

The text that follows the command will be stored and displayed on the site below the colored (Red or Green) header.

In addition to the website files, an Azure Table will be used for storing the history of each status update.

NOTE: The table is not provisioned with the deployment script. It needs to be manually created in Step 2 below.

SignalR manages refreshing the client so that changes made to the HTML are immediately visible without any end user interaction.

Application Insights is used to provide observability on the operation, behavior, and usage of the solution and is "best practice" for building highly available and reliable system... which we expect from any Status Page solution.

Prerequisites

You will need an account with the following services:


Deployment Instructions

The blue button below will deploy all resources needed for this solution in to the Resource Group and Azure region of your choice. The name you choose also determines the URL used to view the Status Page as well as the incoming URL used to trigger updates.

Steps To Deploy

1. Create the Azure Function app, Storage account, and SignalR Service with this button: Deploy to Azure

This will begin deploying everything needed for the solution and will provide a link to the public facing URL of the Status Page as well as a link to your new resource group where you will continue with step 2.


2. In the Azure portal, open the Storage account and add a table named statuses. You do not need to set any properties or add records.

Create table


3. Navigate to the function app, and open the teams-webhook function. Click "Get Function URL" and copy the URL.

4. Open the URL of the Function in a new tab. This is "Status Page" that will change automatically when updated. It is NOT the same as the "Get Function URL" used in the next step.


5. Open Microsoft Teams and navigate to the "Apps" page of the team in which you want to create the bot. Click "Create outgoing webhook".

  • Use StatusPage as the bot name (this is hardcoded, for now).
  • Paste in the function URL, and enter a description and press the create button.

You will be prompted with a secret code for validating webhook calls from Teams. We currently do not use this. Close the dialog box.

6. In Microsoft Teams, update the status page by typing @StatusPage to summon the bot followed by open We are experiencing a problem. Standby for more information

Available commands are:

        @StatusPage open [message]
        @StatusPage update [message]
        @StatusPage close [message]
        @StatusPage help`

This solution is based on the on-stage demonstrations built for Microsoft Ignite The Tour.

To learn more about the full demonstration, view the repo for "OPS20 - Responding To Incidents". Huge Thanks to Anthony Chu in bringing this to life.

Important Resources ⭐️

Microsoft Azure: https://azure.microsoft.com/

Azure Functions:

Azure Storage:

SignalR:

Application Insights:

Microsoft Teams:

Free E-Book - Azure Serverless Computing Cookbook, Second Edition

About


Languages

Language:HTML 61.7%Language:JavaScript 38.3%