Forum Discussion
Receive email for Refresh failure
Hi gemidriver,
At the moment, it is not supported to setup email alert for scheduled refresh failure.
Regards,
Yuliana Gu
ok so it isn't supported
is there something that can be used ?
we have some schedules failing to refresh, and it would be great to be able to be notified in some way
cheers
- v-yulgu-msft8 years agoMicrosoft Employee
Hi gemidriver,
The scheduled refresh history will be recorded in Power BI Report Server database hosted on SQL Server. Maybe you could configure an alert in SQL Server when the state of scheduled refresh is recorded as "Failure" which will send an email to specific recipients.
Reference: PBIRS scheduled refresh data refresh: Execution history
Query Details of given SSRS Report from ReportServer Database tablesGet an alert when a certain record changes in SQL Server
Best regards,
Yuliana Gu
- gemidriver8 years agoHelper II
Hi
Any ideas on tables/columns to monitor?
- Anonymous7 years agoNot applicable
We have setup a couple of SSRS reports to make it easier to see the status of the refreshes across the server, the top level report shows the status of all data refreshes. You could schedule this report to be delivered via email and indeed you could schedule a version of it to be delivered that only showed recent failures. Its not quite what you want but its better than nothing.
The query to get the status of the refreshes is here (NOTE this can be broken by changes to the underlying ReporTServer DB schema in future relases of SSRS-PBI Server
SELECT sj.name AS SQLAgentJobName ,c.name AS ReportName ,c.[path] AS ReportPath ,c.ItemID , CASE WHEN s.laststatus = 'Completed Data Refresh' THEN s.laststatus WHEN LEFT(s.laststatus,19) = 'Data Refresh failed' THEN 'Data Refresh failed' ELSE 'Status Unknown' END AS ShortStatus , 'http://yourservername/yourserverpath/manage/catalogitem/properties' + c.[path] AS managePath , REPLACE( LEFT(c.[path], CHARINDEX('/',c.[path],2)) , '/' ,'') AS basepath ,s.[Description] as SubscriptionName , rs.SubscriptionID , s.laststatus ,sh.SubscriptionHistoryID , CASE s.laststatus WHEN 'Completed Data Refresh' THEN 1 ELSE 0 END AS successFlag , CASE s.laststatus WHEN 'Completed Data Refresh' THEN 0 ELSE 1 END AS FailFlag , s.eventtype , s.LastRunTime , CASE jsch.next_run_date WHEN 0 THEN cast('n/a' as char(10)) ELSE convert(char(10), CONVERT(datetime, CONVERT(char(8), jsch.next_run_date) ) ,120) + ' ' + left( STUFF( (stuff( (replicate( '0', 6 - len(jsch.next_run_time) ) ) + convert(VARCHAR(6), jsch.next_run_time ) ,3 ,0, ':' ) ) ,6 ,0, ':' ), 8) END AS NextRunTime , sj.date_created , sj.date_modified , 1 AS ct FROM ReportServer.dbo.ReportSchedule rs INNER JOIN msdb.dbo.sysjobs sj ON rs.ScheduleID = CAST(sj.name AS uniqueidentifier) and 101 = sj.category_id LEFT OUTER JOIN msdb.dbo.sysjobschedules jsch ON sj.job_id = jsch.job_id INNER JOIN ReportServer.dbo.Subscriptions s ON rs.SubscriptionID = s.SubscriptionID AND 'DataModelRefresh' = s.eventTYpe INNER JOIN ReportServer.dbo.[Catalog] c ON s.report_oid = c.itemid LEFT OUTER JOIN (SELECT MAX(SubscriptionHistoryID) AS SubscriptionHistoryID, SubscriptionID FROM dbo.SubscriptionHistory GROUP BY SubscriptionID) sh ON rs.SubscriptionID = sh.SubscriptionID