Newlines in extraProperties in yaml pipeline are not parsed correctly

Azure Pipeline - Task SonarQubePrepare@4

Newlines in extraProperties in yaml pipeline are not parsed correctly

Steps to reproduce:

1 create a sonarqube prepare task with multiple extraProperties and export it into a yaml pipeline definition. Example output:

- task: SonarQubePrepare@4
  displayName: 'Prepare analysis on SonarQube'
  inputs:
    SonarQube: 'SonarCube Server Connection'
    scannerMode: Other
    extraProperties:
      sonar.projectKey=project-key
      sonar.projectName=project-name
  continueOnError: true
  1. create a tasks that print the environment properties (ex: env | grep SONARQUBE) and look at SONARQUBE_SCANNER_PARAMS

  2. The extraProperties have been added as ,“sonar.projectKey”:“project-key sonar.projectName=project-name” but should have been, “sonar.projectKey”:“project-key”, “sonar.projectName”:“project-name”

Hi,

You have to add a pipe just after ‘extra properties’ like this :

extraProperties: |
  sonar.projectKey=project-key
  sonar.projectName=project-name

Mickaël

1 Like