🛠AppVeyor -> Microsoft Teams📣by@devlead
545 reads

🛠AppVeyor -> Microsoft Teams📣

Read on Terminal Reader

Too Long; Didn't Read


Company Mentioned

Mention Thumbnail
featured image - 🛠AppVeyor -> Microsoft Teams📣
Mattias Karlsson HackerNoon profile picture

@devlead

Mattias Karlsson
react to story with heart

Getting your AppVeyor build status notifications to a Microsoft Teams channel

image

Currently AppVeyor doesn’t out of the box support notifications to Microsoft Teams and Teams doesn’t have an connector ready that supports the default AppVeyor webhook payload.

But AppVeyor do support a generic custom webhook, which lets you using templates customize the webhook body payload to basically fit any http service, without the need for a in-the-middle proxy/transforming service.

In this post guide you through the process of setting up a custom webhook to enable AppVeyor to communicate with Microsoft Teams.

First you need to on the Teams channel you want to get notifications for add an generic incoming webhook

image

Team-> Channel-> Connectors -> Incoming Webhook

You do this by clicking on the “…” after the channel, connectors, choosing a name, optionally a custom icon and then hitting “Create”. Once created you’ll have an unique incoming webhook for the chosen channel.

Then it’s off to AppVeyor where you under a project’s settings notification section choose “Add notification”

image

image

Custom Webhook

  • Pick the “Webhook” option
  • Method “POST”
  • Enter your Teams webhook url
  • Check “Add custom request body”
  • Use “application/json” as custom request body Content-Type header
  • Enter a mustache template to transform the default payload to a Teams Message Card
  • Check which statuses you want notifications for

Then it’s just a matter of hitting save and you’re done. You can go as crazy as you want with the message templates, this is the one I use, feel free to steal it:

This will generate an message looking roughly like this:

image

Microsoft Teams AppVeyor build status notification

If you’re configuring AppVeyor using a yml file, it’s certainly possible to add your Teams notification there, here’s an example appveyor.yml file:

To summarize, it’s just a few steps to enable status notifications and with a little effort you can tailor their appearance to include the information you need!

image

PS.If you have allot of projects you can automate the process using something like PowerShell, which I’ve blogged about in previous posts

Reduce the pain of expiring NuGet keys_So in June of this year the NuGet team wrote a blog post “NuGet API key expiration”, where they basically wrote all…_medium.com

Switching to Microsoft Teams_Lowering barrier to entry by automating the transition to a new service thru REST APIs and PowerShell_medium.com

.DS

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa