Overview of steps
- Set up webhooks for Teams
- Update Mage project settings
Set up webhooks for Teams
Follow these instructions on Teams to setup incoming webhooks for your workspace.Update Mage project settings
Once you’ve set up webhooks for Teams, you should have a webhook URL that Teams provides. Here is an example webhook (yours may vary):- Open the Mage tool in your browser (e.g. http://localhost:6789/).
- Open a pipeline and start editing it (e.g. http://localhost:6789/pipelines/example_pipeline/edit).
-
In your left sidebar in the file browser, scroll all the way down and click
on a file named
metadata.yaml. -
In the
metadata.yamlfile, add a section with the following configuration or update the existingnotification_configsection:If you omit thealert_onsection it will default totrigger_failureandtrigger_passed_sla. Options:trigger_failure: alert when a run of a trigger failstrigger_success: alert when a run of a trigger succeedstrigger_passed_sla: alert when a run of a trigger passes sla
-
In the
metadata.yamlfile, add the following values:Change thewebhook_urlvalues to be the webhook URLs you created from Teams. Thewebhook_urlmust be a string if you are using version 0.9.73 or older and it only accepts one endpoint.
Customize message templates
You can customize message templates innotification_config. Here is an example config:
success, failure, passed_sla scenarios. For each message template,
you can specify either summary or details.
- If you specify the
summary, the Teams message will be yoursummary+ the url of the pipeline run page - If you specify the
details, thedetailswill be used as your Teams message directly
{variable_name} syntax.
Here are the supported variables:
execution_timepipeline_run_urlpipeline_schedule_idpipeline_schedule_namepipeline_schedule_descriptionpipeline_uuiderror- available only for the
failuremessage template
- available only for the
stacktrace- available only for the
failuremessage template
- available only for the
Note: Forpipeline_run_url, the default host ishttp://localhost:6789. You can specifyMAGE_PUBLIC_HOSTto be the host url you want to use in the notification messages.
🚀 Pro Only: Interpolate Mage Variables in Message Templates
Only in Mage Pro.Try our fully managed solution to access this advanced feature.
execution_time, pipeline_uuid, etc), you can also use the
following in your message templates in Mage Pro:
start_timeend_timeduration(in seconds)env(this gets the value stored in theENVenvironment variable)
What next?
Whenever a pipeline run is successfully completed or fails, a Teams message will appear in the channel you configured the webhook URL for. Here is an example of what that message could look like:![]() |
