microsoft / powerbi-powershell

PowerShell community for Microsoft PowerBI. Here you will find resources and source for PowerShell modules targeting PowerBI.
MIT License
346 stars 120 forks source link

New-PowerBIReport does not work with RDL Paginated Reports #269

Open tobimax opened 3 years ago

tobimax commented 3 years ago

When using New-PowerBIReport to upload a RDL Paginated Reports it fails with Bad Request.

New-PowerBIReport : Operation returned an invalid status code 'BadRequest'

How can RDL files be uploaded to Power BI automatically as part of our CI/CD processes.

Thanks

Toby.

plk commented 3 years ago

See also #218 - I have the same problem for months with no information seemingly available on how to do this.

alexchiraples commented 3 years ago

This works for me.

$filePath = 'C:\temp\dummy.rdl'
$reportName = 'dummy.rdl'

$response = New-PowerBIReport -Path $filePath `
                    -Name $reportName `
                    -WorkspaceId $workspaceId `
                    -ConflictAction Abort

I had issues with ConflictAction param. Only Abort and Overwrite are supported with Rdl files. https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group

SSchnietz commented 2 years ago

Thanks to @alexchiraples it works form me too. Make sure to end the name with .rdl . Otherwise you will receive the HTTP 400 BadRequest response.

New-PowerBIReport -Name dummy.rdl ...