A pure bash script sending Microsoft Teams notifications through Workflows' webhooks.
Works with (group) conversations or channels.
- Create a Workflow and get a webhook URL (see Getting a webhook URL)
- Download
teams.shand make sure it has theexecuteauthorization (chmod +x teams.sh) - Call
teams.sh --webhook-url $WEBHOOK_URLto test it - Fully configure your notifications using the whole set of options described below
--title--username--avatar--description--style--field--link
Set a title to the notification
Set an author to the notification
Set a custom avatar for the notification author
Add a text description to the notification
Set the style of the notification card.
Inherited from the Container.style property.
Add a field NAME: Value to the notification.
This option can be provided O to n times to add n fields.
Add a link in the form of a clickable button to the notification.
This option can be provided O to n times to add n links.
A Docker image is available: ghcr.io/dix/teams.sh.
It can be used directly within a CI job to send notifications using a lightweight image.
List of tags: https://github.com/dix/teams.sh/pkgs/container/teams.sh.
The goal here is to create a Workflow on PowerAutomate that is going to publish messages on Teams, in the form of an Adaptive Card, using a webhook as a trigger.
The official Microsoft Support documentation works but can be quite cumbersome.
A more straightforward way to get a webhook URL is to open Teams, right-click on the (group) conversation or channel in which you want to publish notifications, and choose Workflows.
Next:
- Search
webhook - Choose
Send webhook alerts to a chat/channel - Put an explicit
Name(useful for its maintenance later on; not displayed in the notifications) NextAdd workflow- Wait a few seconds and copy the webhook URL provided under
Workflow added successfully!
All the workflows created on your Microsoft account are available on PowerAutomate under the My flows section.
By clicking on a given workflow, you can see its execution history, turn it On/Off, delete it, update its details and also by clicking on Edit, open the workflow editor and by clicking on the When a Teams webhook request is received, access the HTTP URL of the webhook used to trigger the flow.
In its current iteration, the script relies on some hard-coded settings that can't be modified through parameters and require important changes to the source code, mainly:
- timezones for the notifications
- content of the Adaptive Card
Heavily inspired by fieu/discord.sh.

