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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Publish/Import Paginated reports(rdl) to Power BI Service using Power Shell/API

Hello,

Are there any Power shell script/API available to Publish/Import Paginated reports(rdl) to Power BI Service?

Below Post import in Group is not working.

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={datasetDisplayName}

 

https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup

 

Thanks.

1 ACCEPTED SOLUTION
rpatkar
Power BI Team
Power BI Team

While not powershell scripts, we have a migration tool to help move reports from one-prem to cloud service - https://github.com/microsoft/RdlMigration

 

Regarding using powershell / API, have you checked out https://dev.to/kenakamu/upload-rdl-file-s-to-power-bi-via-api-28h

View solution in original post

12 REPLIES 12
EliasP
Frequent Visitor

I have tried everything, even the solution in this post!
Also I tried the powerbi api in Learn Microsoft but I always get bad request (it doesn't say exactly what to put in the body).
For powershell script I only found a solution regarding pbix files and not rdl files.

I have multiple paginated reports (.rdl) in a local location and I want to publish them in app.powerbi programmatically.
Can someone provide a simple example?
Thanks!

hi Elias, you can open a support ticket to get help. Note that Paginated Report import APIs are used by lots of customers and we are not aware of any recent new regression on them. The reports you are trying to upload should not contain unsupported features such as shared datasource or shared datasets. If you have a running instance of PBIRS then we have a nice UI to get you update and upload RDL files, Publish .rdl files to Power BI from Power BI Report Server and Reporting Services - Power BI | Micro....

If using API path, once you verify API signature needed to publish your report then you can use PS scripts to invoke them, some guidance at Power BI Cmdlets reference | Microsoft Learn.

Thank you very much for your response!
I've managed to get it working with cmdlets (powershell) but not with api call.
Regarding cmdlets I believe there is a bug in there.
Specifically you have to use this: 

 

 

 

New-PowerBIReport -Path 'C:\Reports\XXX.rdl' -Name 'xxxx.rdl' -Workspace ( Get-PowerBIWorkspace -Name 'XXXXX' ) -ConflictAction 'Abort'

 

 

 

-ConflictAction doesn't have a fallback, which is quite odd.
If there is a report with the same name in workspace then you have to use 

-ConflictAction 'Overwrite' else you get an error.
If the name of the report doesn't exist in the workspace you have to use -ConflictAction 'Abort' else you get an error.
So, in any case you have to first get all the names of the reports stored in the workspace and then put a logic about the use of -ConflictAction. Meaning, more code and more data retrieval !

The logical assumption would be, if there is a report with the same name then Abort or Overwrite! Thats why we call it ConflictAction!!!
By the way, if you use any other available values like 'Ignore' or 'CreateOrOverwrite' it doesn't work for rdl files!

Regarding REST API (POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={datasetDisplayName})
no matter what I do I get a Bad request error or 403 Forbidden (and I do have the appropriate access rights).
Even in Microsoft Learn ( https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group#code-try-0 ) it is not clear what to put in the body request. I believe the initial goal of this api was only for pbix files and not rdl files. 
If you can give me a real example of how a request (with the body) should look like I would very much appreciate it.
Thanks again,

Elias

hi Elias, one way for you to get a sample of import API is to use fiddler along with Power BI Report Builder (PBIRB) tool. The tool uses public API to publish RDL reports to power bi service and by inspecting the network traffic there, you will see an example of the import API. If you still need help, please file a support ticket.

rpatkar
Power BI Team
Power BI Team

While not powershell scripts, we have a migration tool to help move reports from one-prem to cloud service - https://github.com/microsoft/RdlMigration

 

Regarding using powershell / API, have you checked out https://dev.to/kenakamu/upload-rdl-file-s-to-power-bi-via-api-28h

I tried to follow that PS script, but it was not working for me. I found this much simpler option.

 

New-PowerBIReport -Path [FULL PATH TO FILE] -Name [FULL NAME INCLUDING .rdl] -Workspace [WORKSPACE] -ConflictAction [Abort or Overwrite]

This works perfectly for me.

Is this only for pbix files?

Anonymous
Not applicable

Not able to overwrite the existing report it is creating duplicate report within the workspace, how can we resolve it. If possible can you please share the powershell script

You should use the overwrite option, please check New-PowerBIReport (MicrosoftPowerBIMgmt.Reports) | Microsoft Learn.

If migrating from Power BI Report Server, there is a capability within on-prem server portal to migrate reports to service, see Publish .rdl files to Power BI from Power BI Report Server and Reporting Services - Power BI | Micro...

This PowerShell script works great. Thanks for posting. Looks like I'll be able to use this script as a base to include our SSRS reports in our Azure DevOps pipelines and automated deployment to our Power BI workspaces/environments.

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can find the answer here.

HOW TO CREATE AND PUBLISH PAGINATED REPORTS IN POWER BI SERVICE 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks Lionel but it does not talk about deploying RDL reports using PowerShell or API.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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