Create a logic app for failure notification

ADITYA SINGH 0 Reputation points
2024-04-04T17:24:01.6566667+00:00

How can I create a logic app that sends failure notifications via email when an activity fails in a pipeline in Azure Synapse? Any guidance on the steps to follow or resources to refer to would be appreciated.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,126 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,914 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 24,451 Reputation points
    2024-04-04T22:53:30.8033333+00:00

    What do you need before ?

    • An Azure subscription
    • Azure Synapse Analytics workspace
    • Azure Logic Apps
    • An email service connection in Logic Apps (Office 365, Outlook.com, or Gmail...).

    Step 1: Set Up Failure Alert in Azure Synapse Analytics

    1. In Azure Synapse Analytics, navigate to the Monitoring section, and create an alert for your pipeline. The alert should be configured to trigger on pipeline failure.
    2. Ensure that your Synapse Analytics workspace is configured to send events to Azure Event Grid. This setup allows Azure Event Grid to listen for the specific event of a pipeline failure.

    Step 2: Create a Logic App

    1. In the Azure portal, create a new Logic App in your resource group.
    2. Choose to start with a blank template for your workflow.

    Step 3: Set Up the Trigger

    1. Configure the Logic App trigger to be "When an event is received from Azure Event Grid." This step requires you to specify the subscription and resource type (Azure Synapse Analytics) you're listening to for events.
    2. In the trigger, specify the event type that corresponds to a pipeline failure. This will ensure the Logic App runs when a failure event is detected.

    Step 4: Parse the Event Data

    1. Use the "Parse JSON" action to extract relevant data from the event payload. This includes details like the pipeline name, failure status, and error message.
    2. You might need to provide a schema for the JSON parsing action. You can obtain this by triggering a test failure and copying the event data structure.

    Step 5: Configure Email Notification

    1. Add an action to send an email. Choose the appropriate connector based on your email service
    2. Use the parsed JSON data to configure the email. Include details like the failed pipeline name, error message, and any other relevant information in the email subject and body.

    Check the following links for guidance :

    https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-overview

    https://learn.microsoft.com/en-us/azure/event-grid/overview

    0 comments No comments

  2. Smaran Thoomu 15,685 Reputation points Microsoft Vendor
    2024-04-05T08:35:00.7466667+00:00

    Hi @ADITYA SINGH

    Thanks for the question and using MS Q&A platform.

    In addition to the above answer, I recommend checking out the following link. It can help you understand how to create a logic app that sends email notifications when an activity fails in a pipeline. This video may be helpful for your needs: https://www.youtube.com/watch?v=nN_tkoh4Nps

    Hope this helps. Do let us know if you any further queries.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.