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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jaideepnema
Solution Sage
Solution Sage

Upload Multiple Files on Power Bi Report Server

We have a requirement to move around  50+ Reports from One Power Bi Report Server Instance to another so i would like to know is there any option so that we can bulk upload more than one file on the report server ?

 

As per my understanding the upload file option in the report server only allows the upload one file at once and using Power BI Desktop also we can only upload one file so i would like to know any way by which we can upload more than one file on the report server.

 

4 REPLIES 4
d_gosbell
Super User
Super User

Based on the error message "The remote server returned an error: (422) Unprocessable Entity." I'd guess that one of the file types your are trying to upload is not supported by the script.

 

I use scripts like this to backup pbix files from our server and the only issue I've had is with linked paginated reports so I've just excluded them my scripts since I don't need to back those up anyway.

 

You may have to try smaller batches of files to try and isolate the issue.

d_gosbell
Super User
Super User

One option would be to write a script using the ReportingServicesTools PowerShell module. You could write a script to download from one instance and upload to the other one.

https://www.powershellgallery.com/packages/ReportingServicesTools/0.0.6.5

Hi @d_gosbell ,

I tried creating a small script to achieve the same functionality as shown below:

$ReportPortalUri = 'http://localhost/reports';

$Session=New-RsRestSession -ReportPortalUri $ReportPortalUri;

Write-RsRestFolderContent -Path "F:\PBIX files\" -RsFolder \BulkUpload -Overwrite -Recurse -ReportPortalUri $ReportPortalUri -RestApiVersion v2.0 -WebSession $Session -Verbose
 
But this is not working as it gives me the following error:
Write-RsRestCatalogItem : System.Exception: Failed to create catalog item: The remote server returned an error: (422) Unprocessable Entity. ---> 
System.Net.WebException: The remote server returned an error: (422) Unprocessable Entity.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
--- End of inner exception stack trace ---
At C:\Program Files\WindowsPowerShell\Modules\ReportingServicesTools\0.0.6.6\Functions\CatalogItems\Rest\Write-RsRestFolderContent.ps1:207 char:21
+ ... Write-RsRestCatalogItem -WebSession $WebSession -RestApiV ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-RsRestCatalogItem

Can you please help me understand what i am doing wrong ?

I got it to work, after I changed the back slash to forward slash. 

\BulkUpload to /BulkUpload

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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