microsoft/powerbi-azure-pipelines-extensions

Unexpected error with the extension since tests today

CharlesSaulnier opened this issue · 3 comments

I have been using the extension successfully for a while. Without any code change, I now get Bad request (400) errors when using the task ms-pbi-api.pbi-automation-tools.Pipelines_Deploy.DeploymentPipelines-Deploy@1 in a YAML pipeline. The same script was working on Aug. 23 with the same deployment pipeline.

Task code:

`parameters:

  • name: Environment
    type: string
  • name: datasetName
    type : string
  • name: reportName
    type : string
  • name: comment
    type : string
  • name: pipelineId
    type: string
  • name: pbiConnection
    type: string

stages:

  • stage: PUBLISH
    dependsOn: []
    displayName: "Déploiement dans l'espace sélectionné"
    variables:
    • name: EnvironnementPwrBI
      ${{ if eq(parameters.Environment, 'PWRBI-TA') }}:
      value: Test
      ${{ else }}:
      value: Production
      jobs:
      • deployment: DeployPowerBIArtifacts
        displayName: "Deploy Power BI Artifacts"
        pool:
        name: "Azure Pipelines"
        vmImage: windows-latest
        environment: ${{ parameters.Environment }}
        strategy:
        runOnce:
        deploy:
        steps:
        ## Déploiement sélectif
        - task: ms-pbi-api.pbi-automation-tools.Pipelines_Deploy.DeploymentPipelines-Deploy@1
        displayName: 'Deploy content to the stage'
        inputs:
        pbiConnection: ${{ parameters.pbiConnection }}
        pipeline: ${{ parameters.pipelineId }}
        stageOrder: ${{ variables.EnvironnementPwrBI }}
        note: ${{ parameters.comment }}
        deployType: Selective
        datasets: ${{ parameters.datasetName }}
        reports: ${{ parameters.reportName }}
        createNewWS: false`

Here is the log from my last successful deployment:
2024-08-23T13:46:00.5463661Z ##[section]Starting: Deploy content to the stage 2024-08-23T13:46:00.5481261Z ============================================================================== 2024-08-23T13:46:00.5481425Z Task : Deploy content in a deployment pipeline 2024-08-23T13:46:00.5481545Z Description : Deploy content in a Power BI deployment pipeline 2024-08-23T13:46:00.5481663Z Version : 1.2.0 2024-08-23T13:46:00.5481753Z Author : Microsoft 2024-08-23T13:46:00.5482279Z Help : 2024-08-23T13:46:00.5482354Z ============================================================================== 2024-08-23T13:46:01.6360287Z Importing module MicrosoftPowerBIMgmt.Profile 2024-08-23T13:46:01.7024243Z Activity ID: 286d4658-dc7c-4710-9bc9-c3d770438748 2024-08-23T13:46:01.7131727Z Connecting to Power BI with ServicePrincipal 2024-08-23T13:46:02.9467762Z Getting pipeline: f026edfe-5e50-49f8-aa96-d0651e94d609 2024-08-23T13:46:03.0575525Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines 2024-08-23T13:46:03.4005379Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/stages/1/artifacts 2024-08-23T13:46:03.8612254Z Sending Post request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/Deploy 2024-08-23T13:46:03.8621317Z Request Body: { 2024-08-23T13:46:03.8621681Z "reports": [ 2024-08-23T13:46:03.8622183Z { 2024-08-23T13:46:03.8623043Z "sourceId": "453fc512-8019-4595-83d4-4110bc0003e5" 2024-08-23T13:46:03.8623394Z } 2024-08-23T13:46:03.8623649Z ], 2024-08-23T13:46:03.8625672Z "options": { 2024-08-23T13:46:03.8642989Z "allowTakeOver": false, 2024-08-23T13:46:03.8643735Z "allowOverwriteArtifact": true, 2024-08-23T13:46:03.8644076Z "allowPurgeData": false, 2024-08-23T13:46:03.8644472Z "allowSkipTilesWithMissingPrerequisites": false, 2024-08-23T13:46:03.8644850Z "allowCreateArtifact": true, 2024-08-23T13:46:03.8645184Z "allowOverwriteTargetArtifactLabel": false 2024-08-23T13:46:03.8645509Z }, 2024-08-23T13:46:03.8645793Z "dashboards": [ 2024-08-23T13:46:03.8645985Z 2024-08-23T13:46:03.8646250Z ], 2024-08-23T13:46:03.8646528Z "datasets": [ 2024-08-23T13:46:03.8646790Z { 2024-08-23T13:46:03.8647369Z "sourceId": "cd50d40c-45ba-427b-aa99-524c1567e5b5" 2024-08-23T13:46:03.8647698Z } 2024-08-23T13:46:03.8647948Z ], 2024-08-23T13:46:03.8648249Z "isBackwardDeployment": false, 2024-08-23T13:46:03.8648582Z "sourceStageOrder": 1, 2024-08-23T13:46:03.8648879Z "datamarts": [ 2024-08-23T13:46:03.8649086Z 2024-08-23T13:46:03.8649333Z ], 2024-08-23T13:46:03.8649607Z "dataflows": [ 2024-08-23T13:46:03.8649803Z 2024-08-23T13:46:03.8650049Z ], 2024-08-23T13:46:03.8650489Z "note": "PDATA-18112 - Ajout flag larges groupes securite" 2024-08-23T13:46:03.8650809Z } 2024-08-23T13:46:04.2844900Z Deployment requested sucessfully, Operation ID: 8105c278-670a-49c1-bd92-d4c4cbbe0945 2024-08-23T13:46:04.2852188Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/Operations/8105c278-670a-49c1-bd92-d4c4cbbe0945 2024-08-23T13:46:04.3853211Z Waiting for deployment completion, Status = NotStarted 2024-08-23T13:46:09.3786760Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/Operations/8105c278-670a-49c1-bd92-d4c4cbbe0945 2024-08-23T13:46:09.6252937Z Waiting for deployment completion, Status = Executing 2024-08-23T13:46:14.6312602Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/Operations/8105c278-670a-49c1-bd92-d4c4cbbe0945 2024-08-23T13:46:14.8259890Z Waiting for deployment completion, Status = Executing 2024-08-23T13:46:19.8225560Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/Operations/8105c278-670a-49c1-bd92-d4c4cbbe0945 2024-08-23T13:46:19.9888202Z Deployment completed with status: Succeeded, Operation Id: 8105c278-670a-49c1-bd92-d4c4cbbe0945 2024-08-23T13:46:20.0225454Z ##[section]Finishing: Deploy content to the stage

Now with one of today's tests:
2024-08-27T19:30:34.4130702Z ##[section]Starting: Deploy content to the stage 2024-08-27T19:30:34.4150035Z ============================================================================== 2024-08-27T19:30:34.4150258Z Task : Deploy content in a deployment pipeline 2024-08-27T19:30:34.4150393Z Description : Deploy content in a Power BI deployment pipeline 2024-08-27T19:30:34.4150528Z Version : 1.2.0 2024-08-27T19:30:34.4150599Z Author : Microsoft 2024-08-27T19:30:34.4151125Z Help : 2024-08-27T19:30:34.4151201Z ============================================================================== 2024-08-27T19:30:35.4325878Z Importing module MicrosoftPowerBIMgmt.Profile 2024-08-27T19:30:35.4920461Z Activity ID: b40ce6ab-38c5-4a3d-960f-7b4582f628ae 2024-08-27T19:30:35.5021564Z Connecting to Power BI with ServicePrincipal 2024-08-27T19:30:36.8910356Z Getting pipeline: f026edfe-5e50-49f8-aa96-d0651e94d609 2024-08-27T19:30:36.9080748Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines 2024-08-27T19:30:37.1902852Z Sending Get request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/stages/0/artifacts 2024-08-27T19:30:37.5991605Z Sending Post request to - https://api.powerbi.com/v1.0/myorg/pipelines/f026edfe-5e50-49f8-aa96-d0651e94d609/Deploy 2024-08-27T19:30:37.6007751Z Request Body: { 2024-08-27T19:30:37.6027173Z "reports": [ 2024-08-27T19:30:37.6031972Z { 2024-08-27T19:30:37.6033291Z "sourceId": "a17d28e8-6df6-40be-acf0-55f5a6badaf7" 2024-08-27T19:30:37.6033675Z } 2024-08-27T19:30:37.6034021Z ], 2024-08-27T19:30:37.6034392Z "options": { 2024-08-27T19:30:37.6034767Z "allowTakeOver": false, 2024-08-27T19:30:37.6035255Z "allowOverwriteArtifact": true, 2024-08-27T19:30:37.6035649Z "allowPurgeData": false, 2024-08-27T19:30:37.6036072Z "allowSkipTilesWithMissingPrerequisites": false, 2024-08-27T19:30:37.6036494Z "allowCreateArtifact": true, 2024-08-27T19:30:37.6036903Z "allowOverwriteTargetArtifactLabel": false 2024-08-27T19:30:37.6037287Z }, 2024-08-27T19:30:37.6037631Z "dashboards": [ 2024-08-27T19:30:37.6037901Z 2024-08-27T19:30:37.6038239Z ], 2024-08-27T19:30:37.6038549Z "datasets": [ 2024-08-27T19:30:37.6038891Z { 2024-08-27T19:30:37.6039407Z "sourceId": "3642d916-d5e8-457d-bbf1-0aae9a8ddc1a" 2024-08-27T19:30:37.6039760Z } 2024-08-27T19:30:37.6040088Z ], 2024-08-27T19:30:37.6040436Z "isBackwardDeployment": false, 2024-08-27T19:30:37.6040809Z "sourceStageOrder": 0, 2024-08-27T19:30:37.6041165Z "datamarts": [ 2024-08-27T19:30:37.6041446Z 2024-08-27T19:30:37.6041782Z ], 2024-08-27T19:30:37.6042121Z "dataflows": [ 2024-08-27T19:30:37.6042346Z 2024-08-27T19:30:37.6042674Z ], 2024-08-27T19:30:37.6043218Z "note": "PDATA-18112 - Inventaire des rapports mis à jour" 2024-08-27T19:30:37.6043571Z } 2024-08-27T19:30:37.9635648Z ##[error]The remote server returned an error: (400) Bad Request..Exception Request Id: 00b0a81a-a64b-4445-a624-b185ddeef6b9 Error response body: {"error":{"code":"BadRequest","message":"Bad Request","details":[{"message":"Invalid value","target":"request"}]}} 2024-08-27T19:30:37.9948523Z ##[section]Finishing: Deploy content to the stage

The operation does not reach the API.

I do not see any API change that would explain it. Using the deployment pipeline UI to deploy worked fine

please note that the deployment is successful if I use the same parameters in a script such as the PS sample

linked to issue #26

After further tests, the issue is specifically present after using Git Integration to sync content from the Git repo to the source workspace.

After I forced the git integration to use a new branch, I was able to deploy the same content successfully. This breaks the CI/CD cycle we were trying to implement at our organization, if it were possible to correct this behaviour that would really help