Forum Discussion
Send email notification for Refresh Failure
- 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.
- Click the + below “Refresh a dataset” and choose Add an action.
- Search for Office 365 Outlook and pick Send an email (V2). Sign in with the account that should send the notification.
- 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.
- 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.
- 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.
Thanks Ritaf1983 , i want to apply these steps using service princpial for both refreshing dataset and sending email notification , can you suggest me steps for same