maikvandergaag / msft-extensions

Repository for extensions mainly used for Azure DevOps Extensions
https://msftplayground.com
MIT License
126 stars 81 forks source link

Getting bad request error while trying to publish report #455

Closed pbiall closed 1 year ago

pbiall commented 1 year ago

Describe the issue

Getting bad request error while trying to publish report Please see below for the error 2022-11-08T22:29:34.4311581Z Done processing Power BI Actions 2022-11-08T22:29:34.5767496Z ##[error]Operation returned an invalid status code 'BadRequest'

Extension

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Publish the report without error. Till last month the extension worked fine without any issues.

Situation (please complete the following information):

Log info Please add the log file of the agent in debug mode [Add the variable system.debug with the value 'true ' to your pipeline] 2022-11-09T15:00:17.9959227Z Done processing Power BI Actions 2022-11-09T15:00:18.0211556Z ##[debug]Caught exception from task script. 2022-11-09T15:00:18.0246763Z ##[debug]Error record: 2022-11-09T15:00:18.0903189Z ##[debug]New-PowerBIReport : Operation returned an invalid status code 'BadRequest' 2022-11-09T15:00:18.0918098Z ##[debug]At D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\ps_modules\PowerBI\PowerBI.psm1:797 char:27 2022-11-09T15:00:18.0932203Z ##[debug]+ ... $report = New-PowerBIReport -Path $filePath -Name $fileToPublish -W ... 2022-11-09T15:00:18.0948158Z ##[debug]+ ~~~~~~~~~~~~~ 2022-11-09T15:00:18.0962077Z ##[debug] + CategoryInfo : WriteError: (Microsoft.Power...ewPowerBIReport:NewPowerBIReport) [New-PowerBIReport], Ht tpOperationException 2022-11-09T15:00:18.0976350Z ##[debug] + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Report s.NewPowerBIReport 2022-11-09T15:00:18.0991494Z ##[debug] 2022-11-09T15:00:18.1011481Z ##[debug]Script stack trace: 2022-11-09T15:00:18.1055493Z ##[debug]at Publish-PowerBIFile, D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\ps_modules\PowerBI\PowerBI.psm1: line 797 2022-11-09T15:00:18.1069519Z ##[debug]at , D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\run.ps1: line 116 2022-11-09T15:00:18.1083883Z ##[debug]at , : line 1 2022-11-09T15:00:18.1100305Z ##[debug]at , : line 22 2022-11-09T15:00:18.1114457Z ##[debug]at , : line 18 2022-11-09T15:00:18.1128702Z ##[debug]at , : line 1 2022-11-09T15:00:18.1150742Z ##[debug]Exception: 2022-11-09T15:00:18.1287753Z ##[debug]Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'BadRequest' 2022-11-09T15:00:18.1303276Z ##[debug] at Microsoft.PowerBI.Api.V2.Imports.d8.MoveNext() 2022-11-09T15:00:18.1318216Z ##[debug]--- End of stack trace from previous location where exception was thrown --- 2022-11-09T15:00:18.1332742Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 2022-11-09T15:00:18.1346353Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 2022-11-09T15:00:18.1361767Z ##[debug] at Microsoft.PowerBI.Api.V2.Imports.d7.MoveNext() 2022-11-09T15:00:18.1375979Z ##[debug]--- End of stack trace from previous location where exception was thrown --- 2022-11-09T15:00:18.1391158Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 2022-11-09T15:00:18.1406412Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 2022-11-09T15:00:18.1420113Z ##[debug] at Microsoft.PowerBI.Api.V2.ImportsExtensions.PostImportWithFileInGroup(IImports operations, String groupId, Stream fileStream, String datasetDisplayName, String nameConflict, Nullable`1 skipReport) 2022-11-09T15:00:18.1433585Z ##[debug] at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.PostImportForWorkspace(Guid workspaceId, String datasetDisplayName, String filePath, ImportConflictHandlerModeEnum nameConflict) 2022-11-09T15:00:18.1447358Z ##[debug] at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.PostReportForWorkspace(Guid workspaceId, String reportName, String filePath, ImportConflictHandlerModeEnum nameConflict, Int32 timeout) 2022-11-09T15:00:18.1477193Z ##[debug] at Microsoft.PowerBI.Commands.Reports.NewPowerBIReport.ExecuteCmdlet() 2022-11-09T15:00:18.1490881Z ##[debug] at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord() 2022-11-09T15:00:18.1785665Z ##[error]Operation returned an invalid status code 'BadRequest' 2022-11-09T15:00:18.1794641Z ##[debug]Processed: ##vso[task.logissue type=error]Operation returned an invalid status code 'BadRequest' 2022-11-09T15:00:18.1797310Z ##[debug]Processed: ##vso[task.complete result=Failed] 2022-11-09T15:00:18.2214035Z ##[section]Finishing: Power BI Action: Publish

Additional information I was able successfuly publish from my local desktop using serviceprincipal to the worspace. While using Azure pipelines getting the error.

pbiall commented 1 year ago

Only difference from last month is we added git lfs To the repo and pushed the files.

pbiall commented 1 year ago

This is fixed.

need to edit the "Get Sources" part of your build definition and check option "Checkout files from LFS".

Was able to publish the reports after this.