maikvandergaag / msft-extensions

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

Operation returned an invalid status code 'BadRequest' #467

Closed mironmn closed 1 year ago

mironmn commented 1 year ago

Describe the issue When trying to upload a report I'm facing status code 'BadRequest'

Extension Power BI Actions

Expected behavior Report upload to power bi service workspace

Log info 2023-02-01T20:27:05.2253887Z Done processing Power BI Actions 2023-02-01T20:27:05.2373802Z ##[debug]Caught exception from task script. 2023-02-01T20:27:05.2414660Z ##[debug]Error record: 2023-02-01T20:27:05.3126316Z ##[debug]New-PowerBIReport : Operation returned an invalid status code 'BadRequest' 2023-02-01T20:27:05.3145190Z ##[debug]At D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\ps_modules\PowerBI\PowerBI.psm1:797 char:27 2023-02-01T20:27:05.3162957Z ##[debug]+ ... $report = New-PowerBIReport -Path $filePath -Name $fileToPublish -W ... 2023-02-01T20:27:05.3181583Z ##[debug]+ ~~~~~~~~~~~~~ 2023-02-01T20:27:05.3197521Z ##[debug] + CategoryInfo : WriteError: (Microsoft.Power...ewPowerBIReport:NewPowerBIReport) [New-PowerBIReport], Ht tpOperationException 2023-02-01T20:27:05.3275175Z ##[debug] + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Report s.NewPowerBIReport 2023-02-01T20:27:05.3292222Z ##[debug] 2023-02-01T20:27:05.3350409Z ##[debug]Script stack trace: 2023-02-01T20:27:05.3394347Z ##[debug]at Publish-PowerBIFile, D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\ps_modules\PowerBI\PowerBI.psm1: line 797 2023-02-01T20:27:05.3412851Z ##[debug]at , D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\run.ps1: line 116 2023-02-01T20:27:05.3430164Z ##[debug]at , : line 1 2023-02-01T20:27:05.3463424Z ##[debug]at , : line 22 2023-02-01T20:27:05.3503616Z ##[debug]at , : line 18 2023-02-01T20:27:05.3551699Z ##[debug]at , : line 1 2023-02-01T20:27:05.3606840Z ##[debug]Exception: 2023-02-01T20:27:05.3682892Z ##[debug]Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'BadRequest' 2023-02-01T20:27:05.3699886Z ##[debug] at Microsoft.PowerBI.Api.V2.Imports.d8.MoveNext() 2023-02-01T20:27:05.3739724Z ##[debug]--- End of stack trace from previous location where exception was thrown --- 2023-02-01T20:27:05.3757169Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 2023-02-01T20:27:05.3776052Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 2023-02-01T20:27:05.3818428Z ##[debug] at Microsoft.PowerBI.Api.V2.Imports.d7.MoveNext() 2023-02-01T20:27:05.3912303Z ##[debug]--- End of stack trace from previous location where exception was thrown --- 2023-02-01T20:27:05.3933886Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 2023-02-01T20:27:05.3953395Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 2023-02-01T20:27:05.3973452Z ##[debug] at Microsoft.PowerBI.Api.V2.ImportsExtensions.PostImportWithFileInGroup(IImports operations, String groupId, Stream fileStream, String datasetDisplayName, String nameConflict, Nullable`1 skipReport) 2023-02-01T20:27:05.3997720Z ##[debug] at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.PostImportForWorkspace(Guid workspaceId, String datasetDisplayName, String filePath, ImportConflictHandlerModeEnum nameConflict) 2023-02-01T20:27:05.4025408Z ##[debug] at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.PostReportForWorkspace(Guid workspaceId, String reportName, String filePath, ImportConflictHandlerModeEnum nameConflict, Int32 timeout) 2023-02-01T20:27:05.4048239Z ##[debug] at Microsoft.PowerBI.Commands.Reports.NewPowerBIReport.ExecuteCmdlet() 2023-02-01T20:27:05.4094522Z ##[debug] at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord() 2023-02-01T20:27:05.4371757Z ##[error]Operation returned an invalid status code 'BadRequest' 2023-02-01T20:27:05.4380741Z ##[debug]Processed: ##vso[task.logissue type=error]Operation returned an invalid status code 'BadRequest' 2023-02-01T20:27:05.4384445Z ##[debug]Processed: ##vso[task.complete result=Failed]

Additional information Add any other context about the problem here.