Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Icon for Impactful Individual rankImpactful Individual
4 days ago
Solved

Send email notification for Refresh Failure

i am using Azure Data Factory and Logic App, i want to send email notification if semantic model refresh failure happens, what are the steps to perform using logic app? below is the existing workflow...
  • Ritaf1983's avatar
    4 days ago

    Hi powerbiexpert22​ ,

    You can do this by adding an email action after “Refresh a dataset” and configuring it to run only when the refresh fails.

    1. Click the + below “Refresh a dataset” and choose Add an action.
    2. Search for Office 365 Outlook and pick Send an email (V2). Sign in with the account that should send the notification.
    3. Fill in the recipient, a subject like “Power BI refresh failed”, and a body with whatever details you want. You can use dynamic content here, for example the dataset name or utcNow() for the time.
    4. Open the three dots (…) on the email action and select Configure run after. Select the “Refresh a dataset” step, uncheck is successful, and check has failed and has timed out. Click Done.
    5. Save and test. To trigger the failure path, you can temporarily give the refresh step an invalid dataset ID and confirm the email arrives.

    One thing to be aware of: the Power BI refresh action only kicks off the refresh request, so in some cases the step shows as successful even if the refresh itself fails a few minutes later. If you need to catch those failures too, a more reliable approach is to add an Until loop that calls the Power BI REST API (GET /groups/{groupId}/datasets/{datasetId}/refreshes) and checks the latest refresh status, then send the email if the status is “Failed”.

    Also, if your Logic App is called from an ADF Web activity, you can add a Response action that returns a 500 status on failure so the pipeline is marked as failed as well.