Error: To use the property "sonar.branch.name" and analyze branches

For anyone using Azure Pipelines and running into this issue, you can also work around by running sonar from the command line, or create your own Build Task: Create a Custom Build Task.

Here are simple cmd tasks for your pipelines:

- task: CmdLine@2
  displayName: 'Install Sonar Tools and Start Scanner'
  inputs:
    script: |
      echo Installing sonarScanner tool
      dotnet tool install --global dotnet-sonarscanner 

      echo Start Scanner
      dotnet-sonarscanner begin /k:"CreditCards" /d:sonar.host.url="https://YourSonarWebsite.com" /d:sonar.login="Token00000000000000000000000000000000000"

##
## Do The Build
##

- task: CmdLine@2
  displayName: 'Collect Sonar results and Upload'
  inputs:
    script: |
      echo Run Sonar End
      dotnet-sonarscanner end /d:sonar.login="Token00000000000000000000000000000000000"
2 Likes