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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Mouad
New Member

Automating RDL files upload/import/deploy to Power BI service

Hello, 

 

I have a question, which is kind of frequent, to which I didn't find any conrete solution. 

 

I want to upload/deploy/import Rdl files to power bi service automatically, using a powershell script for example maybe (it is what I'm trying to do now at least, any other solution would be good too, but i prefer this one), but I could not reach any concrete results. 

 

I'm using this script : https://dev.to/kenakamu/upload-rdl-file-s-to-power-bi-via-api-28h I modified the group id and the path to the rdl file in my desktop, and also checked the file's encoding (utf-8) but still nothing. 

The error I'm getting now (using the script that i joined as described above)  : 

 

Invoke-RestMethod : {"error":{"code":"PaginatedReportInvalidRdlDefinition","pbi.error":{"code":"PaginatedReportInvalidR
dlDefinition","parameters":{},"details":[],"exceptionCulprit":1}}}
Au caractère C:\Users\PMAI05212\Desktop\test_script2.ps1:38 : 15
+ ... $report = Invoke-RestMethod -Uri $url -Method Post -Headers $header ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation : (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebEx
ception
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

 

There are some questions in the same direction ( I might have checked them all ) but I couldn't find a working solution.

Does anyone have an idea how to do it ? Or what I can do to solve it ? 

 

I changed also the Invoke-RestMethod to Invoke-PowerBIRestMethod but i get the same as thishttps://community.powerbi.com/t5/Service/RDL-import-via-API/td-p/1032623 

 

 

Many thanks.

 

 

1 REPLY 1
v-xulin-mstf
Community Support
Community Support

Hi @Mouad,

 

Reference to this post may be helpful:

Unable to call imports endpoint · Issue #46 · microsoft/powerbi-powershell · GitHub

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.