Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MeiSalas
New Member

How Data Refresh programmatically?

Is there another way to do a data refresh for a PowerBI report (via PowerShell or Rest API, how to access the Rest API, do we enable this?)

 

I have a query to check what powerBI report has failed, but in order to do the refresh, i either go to the report and do the refresh, or run the job that corresponds to the Schedule GUID. 

Is there a way to do a Data Refresh just by knowing the Catalog Item?   Without doing a Schedule?

 

Thanks a lot!

1 ACCEPTED SOLUTION


@lbendlin wrote:

I never know if a question posted in the report server section is actually related to report server. The "catalog" wording should have been my hint to leave this alone as I have no experience with report server.


🙂 it can be hard to tell. A lot of people do not differentiate between "Server" and "Service"

 


@lbendlin wrote:

Is there a way to use the SQL scheduler?


Not easily, the SQL agent jobs are created with Schedule GUID so you are faced with the orignal issue of having to link a ScheduleID and a catalog item

View solution in original post

5 REPLIES 5
enricocorizza
Regular Visitor

You can alternatively run an SQL Query to do that and call it from PowerShell. We do it directly with SQL in some agent jobs since we want to refresh after certain updates in the database for our datawarehouse. We have a custom view with all subscriptions and relative agent jobs and then it's very easy to trigger subscriptions and schedule refresh this way:

 

 

DECLARE @SQLAgent_Job_Name NVARCHAR(36) = (
SELECT [SQLAgent_Job_Name]
FROM [Reports].[AllSubscriptionsAndJobs]
WHERE ReportName = 'Your report name in Report Server / PBRS'
)

EXEC msdb.dbo.sp_start_job @job_name = @SQLAgent_Job_Name

d_gosbell
Super User
Super User


@MeiSalas wrote:

Is there a way to do a Data Refresh just by knowing the Catalog Item?   Without doing a Schedule?


No, for the on-prem Report Server you can only trigger a refresh via a schedule. Note that you can create a schedule with a one off date in the past and trigger that, but there is no API to refresh with just the catalog item reference.

 

@lbendlin - Power Automate is a great solution for the cloud service, but it's not a solution for the on-prem Report Server.

@d_gosbell noted. I never know if a question posted in the report server section is actually related to report server. The "catalog" wording should have been my hint to leave this alone as I have no experience with report server.

 

Is there a way to use the SQL scheduler?


@lbendlin wrote:

I never know if a question posted in the report server section is actually related to report server. The "catalog" wording should have been my hint to leave this alone as I have no experience with report server.


🙂 it can be hard to tell. A lot of people do not differentiate between "Server" and "Service"

 


@lbendlin wrote:

Is there a way to use the SQL scheduler?


Not easily, the SQL agent jobs are created with Schedule GUID so you are faced with the orignal issue of having to link a ScheduleID and a catalog item

lbendlin
Super User
Super User

yes to all - plus you can do it via Power Automate. You can even get more granular and refresh individual tables and even partitions.

 

Enhanced refresh with Power BI REST API - Power BI | Microsoft Learn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.