Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
Are there any Power shell script/API available to Publish/Import Paginated reports(rdl) to Power BI Service?
Below Post import in Group is not working.
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={datasetDisplayName}
https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup
Thanks.
Solved! Go to Solution.
While not powershell scripts, we have a migration tool to help move reports from one-prem to cloud service - https://github.com/microsoft/RdlMigration
Regarding using powershell / API, have you checked out https://dev.to/kenakamu/upload-rdl-file-s-to-power-bi-via-api-28h
I have tried everything, even the solution in this post!
Also I tried the powerbi api in Learn Microsoft but I always get bad request (it doesn't say exactly what to put in the body).
For powershell script I only found a solution regarding pbix files and not rdl files.
I have multiple paginated reports (.rdl) in a local location and I want to publish them in app.powerbi programmatically.
Can someone provide a simple example?
Thanks!
hi Elias, you can open a support ticket to get help. Note that Paginated Report import APIs are used by lots of customers and we are not aware of any recent new regression on them. The reports you are trying to upload should not contain unsupported features such as shared datasource or shared datasets. If you have a running instance of PBIRS then we have a nice UI to get you update and upload RDL files, Publish .rdl files to Power BI from Power BI Report Server and Reporting Services - Power BI | Micro....
If using API path, once you verify API signature needed to publish your report then you can use PS scripts to invoke them, some guidance at Power BI Cmdlets reference | Microsoft Learn.
Thank you very much for your response!
I've managed to get it working with cmdlets (powershell) but not with api call.
Regarding cmdlets I believe there is a bug in there.
Specifically you have to use this:
New-PowerBIReport -Path 'C:\Reports\XXX.rdl' -Name 'xxxx.rdl' -Workspace ( Get-PowerBIWorkspace -Name 'XXXXX' ) -ConflictAction 'Abort'
-ConflictAction doesn't have a fallback, which is quite odd.
If there is a report with the same name in workspace then you have to use
-ConflictAction 'Overwrite' else you get an error.
If the name of the report doesn't exist in the workspace you have to use -ConflictAction 'Abort' else you get an error.
So, in any case you have to first get all the names of the reports stored in the workspace and then put a logic about the use of -ConflictAction. Meaning, more code and more data retrieval !
The logical assumption would be, if there is a report with the same name then Abort or Overwrite! Thats why we call it ConflictAction!!!
By the way, if you use any other available values like 'Ignore' or 'CreateOrOverwrite' it doesn't work for rdl files!
Regarding REST API (POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={datasetDisplayName})
no matter what I do I get a Bad request error or 403 Forbidden (and I do have the appropriate access rights).
Even in Microsoft Learn ( https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group#code-try-0 ) it is not clear what to put in the body request. I believe the initial goal of this api was only for pbix files and not rdl files.
If you can give me a real example of how a request (with the body) should look like I would very much appreciate it.
Thanks again,
Elias
hi Elias, one way for you to get a sample of import API is to use fiddler along with Power BI Report Builder (PBIRB) tool. The tool uses public API to publish RDL reports to power bi service and by inspecting the network traffic there, you will see an example of the import API. If you still need help, please file a support ticket.
While not powershell scripts, we have a migration tool to help move reports from one-prem to cloud service - https://github.com/microsoft/RdlMigration
Regarding using powershell / API, have you checked out https://dev.to/kenakamu/upload-rdl-file-s-to-power-bi-via-api-28h
I tried to follow that PS script, but it was not working for me. I found this much simpler option.
Is this only for pbix files?
Not able to overwrite the existing report it is creating duplicate report within the workspace, how can we resolve it. If possible can you please share the powershell script
You should use the overwrite option, please check New-PowerBIReport (MicrosoftPowerBIMgmt.Reports) | Microsoft Learn.
If migrating from Power BI Report Server, there is a capability within on-prem server portal to migrate reports to service, see Publish .rdl files to Power BI from Power BI Report Server and Reporting Services - Power BI | Micro...
This PowerShell script works great. Thanks for posting. Looks like I'll be able to use this script as a base to include our SSRS reports in our Azure DevOps pipelines and automated deployment to our Power BI workspaces/environments.
Hi @Anonymous ,
You can find the answer here.
HOW TO CREATE AND PUBLISH PAGINATED REPORTS IN POWER BI SERVICE
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Lionel but it does not talk about deploying RDL reports using PowerShell or API.
User | Count |
---|---|
47 | |
31 | |
28 | |
27 | |
26 |
User | Count |
---|---|
58 | |
55 | |
36 | |
33 | |
28 |