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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

SolomonovAnton

How to Trigger a Report Refresh Programmatically in Power BI Report Server

What you need

  • Access to the Power BI Report Server web portal
  • An account with permissions to create and execute refresh plans
  • PowerShell 5.1 or later
    The ReportingServicesTools module is available from the PowerShell Gallery and supports Power BI Report Server operations. 

1. Create a Cache Refresh Plan

Before you can trigger a refresh programmatically, make sure the report already has a Cache Refresh Plan.

The easiest way is through the web portal:

  1. Open your report portal, for example:
    http://<YourReportServer>/reports
  2. Navigate to the folder that contains the report
  3. Open Manage
  4. Go to Cache Refresh Plans
  5. Create a new plan and save it

Even if you do not intend to rely on the schedule itself, the plan must exist so that you can execute it programmatically later.

Once the plan is created, you can call it through the REST API. 


2. Get the Cache Refresh Plan ID

To execute the plan, you need its unique identifier (GUID).

There are two practical ways to get it.

Option 1: Get it from the browser

This is often the quickest method.

  1. Open the web portal and go to the report’s Cache Refresh Plans page
  2. Press F12 to open Developer Tools
  3. Go to the Network tab
  4. Refresh the page or click the refresh plan entry
  5. Look for a request containing CacheRefreshPlans

In the request URL or response payload, you will see the plan ID, for example:

bda19862-3cfd-410d-b402-eb741d0044a4

Option 2: Get it via the REST API

First, get the report ID.

You can do that in one of two ways:

Option A: Call the reports endpoint and find the report by name or path:

GET http://<YourReportServer>/reports/api/v2.0/PowerBIReports

Option B: Query the dbo.Catalog table in the ReportServer database.

Then call the endpoint for that report’s cache refresh plans:

GET http://<YourReportServer>/reports/api/v2.0/PowerBIReports(<REPORT_ID>)/CacheRefreshPlans

This endpoint is part of the documented Power BI Report Server REST API. 

If you are using Postman, configure authentication as NTLM or Windows Authentication, and provide your Windows credentials.

A typical response looks like this:

{
  "value": [
    {
      "Id": "bda19862-3cfd-410d-b402-eb741d0044a4",
      "Description": "My refresh plan",
      "CatalogItemPath": "/Folder/ReportName"
    }
  ]
}

Save the value of the Id field. You will use it in the next step.


3. Install the ReportingServicesTools PowerShell module

For convenience, I recommend using the ReportingServicesTools module. It simplifies authentication and handles the REST calls for you.

Open PowerShell as Administrator and run:

Install-Module -Name ReportingServicesTools -Force

If prompted, confirm the installation.

To verify that the module is installed:

Get-Command -Module ReportingServicesTools

You should see cmdlets including:

  • Start-RsRestCacheRefreshPlan
  • Get-RsRestCacheRefreshPlan
  • Get-RsRestCacheRefreshPlanHistory

These cmdlets are included in the module’s public command set. 


4. Trigger the refresh

Now for the key step: execute the refresh plan by its ID.

Run this in PowerShell:

Start-RsRestCacheRefreshPlan `
    -ReportPortalUri "http://<YourReportServer>/reports" `
    -Id "bda19862-3cfd-410d-b402-eb741d0044a4"

Parameters

  • -ReportPortalUri — the URL of your Power BI Report Server portal
    Use the portal URL, not the /api/v2.0 endpoint
  • -Id — the GUID of the Cache Refresh Plan from the previous step

If the command succeeds, you may see a warning like this:

WARNING: No XSRF Token detected! This might be due to XSRF token disabled.

That is typically informational rather than fatal. It usually means CSRF protection is disabled on the server, which is common in many internal environments.

At that point, the refresh has been triggered.

The underlying REST API also supports immediate execution of a Cache Refresh Plan. 


5. Check the execution result

To confirm that the refresh completed successfully, you can check the refresh plan history.

Using PowerShell:

Get-RsRestCacheRefreshPlanHistory `
    -ReportPortalUri "http://<YourReportServer>/reports" `
    -Id "bda19862-3cfd-410d-b402-eb741d0044a4"

Or via the REST API:

GET http://<YourReportServer>/reports/api/v2.0/CacheRefreshPlans(bda19862-3cfd-410d-b402-eb741d0044a4)/History

The response includes recent executions with fields such as:

  • StartTime
  • EndTime
  • Status (Completed / Failed)

The history endpoint is part of the documented Cache Refresh Plans API, and the PowerShell module exposes a corresponding history cmdlet. 


Final thoughts

This approach gives you a practical event-driven refresh pattern for Power BI Report Server:

  1. Create a Cache Refresh Plan in the web portal
  2. Retrieve its ID from the browser or the REST API
  3. Install ReportingServicesTools
  4. Trigger the refresh with a single PowerShell command

That makes it easy to integrate report refresh into:

  • ETL workflows
  • SQL Agent jobs
  • Windows Task Scheduler
  • Jenkins pipelines
  • Custom monitoring or alerting solutions

If your refresh timing depends on real system activity rather than a fixed schedule, this method is a clean and reliable alternative.


Useful references