Forum Discussion
Scheduled Refresh notifications (On-Premise)
WHich one of the 150 SQL Agent jobs do I do that on. They are just labeled as a GUID.
This doesn't seem like a good solution.
Microsoft needs to fix this if there is no other way. Why don't they just add a task at the end of these SQL Agent jobs for the server administrator if it is setup in the Power BI Server backend?
Seems like basic functionality is missing here.
Please use the below query and schedule it through SQL Server Agent to notify/email certain users if a Data Refresh failure happens and that will notify you if a data refresh did not run successfuly.
SELECT Subscriptions.Description,
Subscriptions.LastStatus,
Subscriptions.EventType,
MAX(SubscriptionHistory.StartTime) start_time,
MAX(SubscriptionHistory.EndTime) end_time,
SubscriptionHistory.Message,
SubscriptionHistory.Details
FROM subscriptions
JOIN dbo.SubscriptionHistory
ON Subscriptions.SubscriptionID = SubscriptionHistory.SubscriptionID
WHERE CAST(StartTime AS Date) = CAST(GETDATE() AS DATE)
GROUP BY Subscriptions.Description,
Subscriptions.LastStatus,
Subscriptions.EventType,
SubscriptionHistory.Status,
SubscriptionHistory.Message,
SubscriptionHistory.Details
HAVING Subscriptions.LastStatus LIKE 'Data Refresh failed%'
Note: This query will be run in the BI Database that has the metadata for the Power BI Report Server.
Hope this helps!