skip to Main Content

How to get alerts in teams and email when a pipeline fails in ADF in monitor alerts.

Is there any way to achieve it?

2

Answers


  1. I suggest you the following tutorial to set up alerts in your Azure Data Factory.

    https://azure.microsoft.com/en-us/blog/create-alerts-to-proactively-monitor-your-data-factory-pipelines/

    enter image description here

    If you click New Alert Rule, you can create different alerts depending on the event and the severity level.

    enter image description here

    There are several different option to be notified

    enter image description here

    EDIT:

    Regarding the teams notifications, here is a tutorial about how to set up a notifications channel (creating a pipeline).

    https://learn.microsoft.com/en-us/azure/data-factory/how-to-send-notifications-to-teams?tabs=data-factory

    Looking the MS docs, do not seem to have a plug and play integration as emails or sms…

    Login or Signup to reply.
  2. In alert rule actions there is no direct way, but you can Customize alert notifications by using Logic Apps in alert’s action group.

    You need to create a logic app the send message in group chat or in a channel

    1. In the Logic Apps Designer page, select When a HTTP request is received.

    2. Paste the common alert schema into the Request Body JSON Schema field from the following JSON:

      enter image description here

    JSON Sample:

    {
        "type": "object",
        "properties": {
            "schemaId": {
                "type": "string"
            },
            "data": {
                "type": "object",
                "properties": {
                    "essentials": {
                        "type": "object",
                        "properties": {
                            "alertId": {
                                "type": "string"
                            },
                            "alertRule": {
                                "type": "string"
                            },
                            "severity": {
                                "type": "string"
                            },
                            "signalType": {
                                "type": "string"
                            },
                            "monitorCondition": {
                                "type": "string"
                            },
                            "monitoringService": {
                                "type": "string"
                            },
                            "alertTargetIDs": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "configurationItems": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "originAlertId": {
                                "type": "string"
                            },
                            "firedDateTime": {
                                "type": "string"
                            },
                            "resolvedDateTime": {
                                "type": "string"
                            },
                            "description": {
                                "type": "string"
                            },
                            "essentialsVersion": {
                                "type": "string"
                            },
                            "alertContextVersion": {
                                "type": "string"
                            }
                        }
                    },
                    "alertContext": {
                        "type": "object",
                        "properties": {
                            "properties": {},
                            "conditionType": {
                                "type": "string"
                            },
                            "condition": {
                                "type": "object",
                                "properties": {
                                    "windowSize": {
                                        "type": "string"
                                    },
                                    "allOf": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "metricName": {
                                                    "type": "string"
                                                },
                                                "metricNamespace": {
                                                    "type": "string"
                                                },
                                                "operator": {
                                                    "type": "string"
                                                },
                                                "threshold": {
                                                    "type": "string"
                                                },
                                                "timeAggregation": {
                                                    "type": "string"
                                                },
                                                "dimensions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "name",
                                                            "value"
                                                        ]
                                                    }
                                                },
                                                "metricValue": {
                                                    "type": "integer"
                                                },
                                                "webTestName": {}
                                            }
                                        }
                                    },
                                    "windowStartTime": {
                                        "type": "string"
                                    },
                                    "windowEndTime": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "customProperties": {}
                }
            }
        }
    }
    
    1. Then click on (+) sign below to add another action In the search field, search for Microsoft Teams.

    2. Select Microsoft Teams. Select Post message in a chat or channel from the list of actions and Sign in to Teams when you’re prompted to create a connection.

    3. Select User from the Post as dropdown. Select Group chat from the Post in dropdown.

    4. Create the message text in the Message field by entering static text and including content taken from the alert payload by choosing fields from the Dynamic content list. For example:

      • name:
        enter image description here
    5. Select Save. You’ve created a logic app that sends a Teams message to the specified group, with details from the alert that triggered it.

    The next step is to create an action group to trigger your logic app.

    1. Go to the Azure Monitor page and select Alerts from the pane on the left.

    2. Select Action groups > Create.

    3. Select values for Subscription, Resource group, and Region.

    4. Enter a name for Action group name and Display name.

    enter image description here

    1. Select the Actions tab.

    2. On the Actions tab under Action type, select Logic App.

    3. In the Logic App section, select your logic app from the dropdown.

    4. Set Enable common alert schema to Yes. If you select No, the alert type determines which alert schema is used. For more information about alert schemas

    5. Select OK.

    6. Enter a name in the Name field.

    enter image description here

    1. Select Review + create > Create.

    Now add this action group in your alert rule you will get teams notification whel alert rule is triggered.

    Output:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search