Forum Discussion

Mouad's avatar
Mouad
New Member
5 years ago

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.