MSTeams Notification not sent on failure callback for specific DAG

Hi everyone, I’ve set the on_failure_callback with the MSTeamsWebhookOperator to raise notifications in a teams channel, and for some DAGS is notifying in the team channel, but for a specific DAG is not triggering the notification when it failed. The Airflow version is 2.3.2.

This is part of the log I have in Airflow, which is the same result that I get when others DAGS failed and it notifies correctly in teams channel.

[2024-02-02, 12:12:42 UTC] {} INFO - Using connection ID ‘ms_teams_callbacks’ for task execution.
[2024-02-02, 12:12:42 UTC] {} INFO - Sending ‘POST’ to url:
[2024-02-02, 12:12:44 UTC] {} INFO - Webhook request sent to MS Teams

This implementation have been based on GitHub - astronomer/cs-tutorial-msteams-callbacks: Example DAGs demonstrating how to implement alerting and notifications via Microsoft Teams. If someone have experienced this or could guide me to debug this problem. I’ve been investigating how to get the post that is generated in these cases to at least try them in postman and analyze what could be the problem.

Hey @matimib

Welcome to Astronomer Forum!

Do you get an error for this DAG not able to reach Teams API endpoint or it just errors due to the Task error and the API call is successful?

Could you turn on the Debug Logging mode using AIRFLOW__LOGGING__LOGGING_LEVEL =DEBUG and see if you see any details?


Thanks @manmeet,
The problem is that the DAG is not able to reach Teams API. Finally we changed the library to perform this functionality. We incorporated pymsteams library and it solved the problem, sending notifications when the DAG failed.

I don’t understand well what was the problem. If I have time in the future I will post more details using the debug logs to clear out the problem.

1 Like