microsoft / microsoft/powerbi-powershell
Unable to upload pbix using New-PowerBIreport on linux
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 413
- Forks
- 134
- Avg merge
- 33m
- Merged PRs (30d)
- 1
Description
I am attempting to upload a power BI report to a workspace with the New-PowerBireport command, and this works correctly on a windows machine. It does not work correctly on a Linux Machine - I get a 400 Badrequest error , and running
Resolve-PowerBIError -Last
gives me the following error. Is this due to some kind of issue with how it encodes the file for upload on linux vs windows?
RequestId : 89a3c4c7-862c-4501-a188-29122e195a48
Response : Bad Request (400): {"error":{"code":"RequestedFileIsEncryptedOrCorrupted","pbi.error":{"code":"RequestedFileIsE
ncryptedOrCorrupted","parameters":{},"details":[],"exceptionCulprit":1}}}
PowerBIErrorInfo : RequestedFileIsEncryptedOrCorrupted
ResponseDate : Wed, 24 Nov 2021 17:32:10 GMT
RequestMethod : POST
RequestUri : https://api.powerbi.com/v1.0/myorg/groups/dbdc5ea8-3e63-4286-a443-8fd93672545d/imports?datasetDisplayName=PBI_D
ATA_MODEL&nameConflict=Overwrite
InvocationInfo : {New-PowerBIReport}
Line : New-PowerBIReport -Path $Datamodelfile -Name "PBI_DATA_MODEL" -Workspace $Workspace -ConflictAction OverWrit
e -Timeout $Timeout -verbose
Position : At /home/bitestuser/Data-PowerBI/deploy_power_bi.ps1:134 char:4
+ New-PowerBIReport -Path $Datamodelfile -Name "PBI_DATA_MODEL" -Wor …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StackTrace : at Microsoft.PowerBI.Api.V2.Imports.UploadFile(String groupId, Stream file, String datasetDisplayName, Strin
g nameConflict, Nullable`1 skipReport, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.PowerBI.Api.V2.Imports.PostImportFileWithHttpMessage(String groupId, Stream file, String datase
tDisplayName, String nameConflict, Nullable`1 skipReport, Dictionary`2 customHeaders, CancellationToken cancell
ationToken)
at Microsoft.PowerBI.Api.V2.ImportsExtensions.PostImportWithFileInGroup(IImports operations, String groupId,
Stream fileStream, String datasetDisplayName, String nameConflict, Nullable`1 skipReport)
at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.PostImportForWorkspace(Guid workspaceId, String datase
tDisplayName, String filePath, ImportConflictHandlerModeEnum nameConflict)
at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.PostReportForWorkspace(Guid workspaceId, String report
Name, String filePath, ImportConflictHandlerModeEnum nameConflict, Int32 timeout)
at Microsoft.PowerBI.Commands.Reports.NewPowerBIReport.ExecuteCmdlet()
at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord()
HistoryId : 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the New-PowerBIReport invocation at /home/bitestuser/Data-PowerBI/deploy_power_bi.ps1:134 and reproduce the upload on Linux, using Resolve-PowerBIError -Last to capture the response. Trace the report upload path associated with New-PowerBIReport and compare it with the working Windows case; done means the same PBIX uploads successfully on Linux without the 400 RequestedFileIsEncryptedOrCorrupted error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100