Subscribe to Cloud Events webhook subscriptions (such as from Azure EventGrid) and report them to a chat room.
About Abbot
Abbot is a programmable bot that turns your team chat into a shared command center. We handle all the boilerplate of building and running these conmmands so that you can focus on making tools that help you ship faster.
We built Abbot because we saw the power of this style of work (called ChatOps), when we worked at GitHub. ChatOps made it possible for GitHub to work productively without meetings, while globally distributed. We think it's a pretty great way to work, so we made it easy to use in Slack, Discord, and Microsoft Teams.
You can read more about Abbot here, check out our blog, or take a look at some of the other cool packages available as a one-click install from Abbot's Package Directory.
README
Subscribe to events in your cloud infrastructure such as deployment slot failover!
It's helpful to know when important events happen in your cloud infrastructure. The cloud-event
skill can help. It allows you to subscribe to cloud events and report them into chat. It is capable of supporting events in all cloud providers, but currently only has built in support for Azure App Service events.
For example, suppose you use Blue Green deployments using Slots in Azure. You can subscribe to slot swaps to know when your deployments succeed or fail.
Subscribing to events is pretty easy. I posted a video walkthrough on YouTube or you can follow the instructions below.
- First, install and save the skill!
- Then, attach the skill to a chat channel. For example, in our
#ops
room I ran the command: @abbot attach cloud-event
.
- When you attach the skill, it'll give you a URL to grab the HTTP Trigger URL. You'll need this in a moment.
- Go to Azure Event Grid Subscriptions in the Azure Portal and create a new subscription.
- For the "Event Schema" choose "Cloud Event Schema 1.0".
- For the "Topic Types" choose "App Services."
- For "Endpoint Type" choose "Web Hook" and supply the HTTP Trigger URL for the skill you created when you attached the skill.
And that's it! Now when the events you subscribed to occur, you'll get a notification in chat.
This skill supports the Cloud Events WebHook Spec v1.0. for subscribing to cloud events so it can be adapted to any cloud hosting provider. Over time I plan to add support for all kinds of events.
Usage
Run @abbot attach cloud-event
in the chat room that should receive these events, then supply the trigger URL as the webhook URL to the event source.
The following commands work in chat:
* @abbot cloud-event list
- List all the trigger URLs used as webhooks.
* @abbot cloud-event list {triggerUrl}
- lists the allowed origins for the specified trigger URL. Instead of the URL, you can specify the number of the trigger URL in the list ex. @abbot list 2
.
* @abbot cloud-event remove {triggerUrl}
- removes all allowed origins for that trigger URL. No webhook requests at that URL will be accepted. You can specify the number of the trigger to remove as well: @abbot remove 2
.
* @abbot cloud-event remove {triggerUrl} {origin}
- removes the specific allowed origin for the trigger URL. You can specify the order of the trigger instead of the trigger URL. Ex. @abbot cloud-event remove 2 example.com
removes example.com
from the allowed origin for the second trigger.