Teams Webhook Walkthrough¶
Use case: When a task fails for any batch pipeline in a journey, Observability sends you a detailed message, directly in Microsoft Teams.
Step 1: Create a Microsoft Teams webhook URL¶
The URL will look something like this when you're done: https://m365x012345.webhook.office.com/EXAMPLE
Copy and save the URL to use in the next step.
Step 2: Set up your Observability rule¶
When you have your personalized Microsoft Teams webhook URL, log into Observability, select your project, and open the Journeys page.
- Select the journey you want to define the rule for, then select the Rules tab.
- Click Add Rule.
- Use the drop-downs to fill in the rule predicate: When task status is Failed for any component in journey.
- Click Add Action and select Web Request.
-
Fill in the Send Web Request fields.
- Select
POSTas the Method. -
URL is the URL you copied in Step 1 above.
For example:
https://m365x012345.webhook.office.com/EXAMPLE -
Use the following Payload:
{ "@context": "http://schema.org/extensions", "@type": "MessageCard", "sections": [ { "activityTitle": "Failure in task '{task.name}'", "facts": [ { "name": "Project", "value": "{project.name}" }, { "name": "Pipeline", "value": "{pipeline.name}" }, { "name": "Run", "value": "{run.key}" }, { "name": "Task", "value": "{task.name}" }, { "name": "Status", "value": "{run_task.status}" }, { "name": "Link", "value": "https://{company.ui_url}/projects/{project.id}/runs/{run.id}" } ], "markdown": true } ], "summary": "Failure in task {task.name}", "themeColor": "f44336" } -
Teams does not require headers for calling its webhook, so leave this field blank.
- Select
-
Click Save.
If tasks fail for the batch pipeline components included in this journey, you'll receive a message directly in Microsoft Teams that includes a link to Observability, so you can take action.
Note
Task status rules only trigger for batch pipeline components.