microsoft / ReportingServicesTools

Reporting Services Powershell Tools
MIT License
458 stars 213 forks source link

Write-RsRestCatalogItem doesn't work with large Power BI reports (>25 MB or > MinLargeFileSizeInMb) #417

Open snarf-br opened 10 months ago

snarf-br commented 10 months ago

Do you want to request a feature or report a bug?

bug, tested with 28MB Power BI report.

What is the current behavior?

Error message: Failed to create catalog item: Response status code does not indicate success: 500 (Internal Server Error).

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

1: Create Power BI report larger than 25 MB, but smaller than 2GB, name it e.g. LargeReport.pbix 2: In Powershell : Create session to your local Power BI report server 3: Write-RsRestCatalogItem -WebSession $Session -Path "LargeReport.pbix" -RsFolder $Destination -OverWrite -Verbose

What is the expected behavior? Successfully uploaded Report, similar to the quick and dirty

$Uri= "https://localreportserver/powerbireports/api/v2.0/PowerBIReports(Path='/LargeReport').Model.Upload

$Form= @{ 
    File= Get-Item -Path "LargeReport.pbix"
}
Invoke-WebRequest -Uri $Uri -Method Post -Form $Form -UseDefaultCredentials -Verbose

which uploads the file correctly (barring typo's) using the Uri the library constructs internally if the current user has the correct rights.

Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?

Powershell 7 on Windows, Power BI Report Server September 2023

This is the first time we had a Power BI report larger than 25 MB to deploy.