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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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

Top Solution Authors