Scanning Pull Request gives Not authorized error (Azure Devops Services)

Hello everyone,

I’m having problem scanning Pull Request’s as a form of Build Validations inside Azure Pipelines. Everything was working great till May 31 when I start to have this problems.

I’m not sure if it is related to the last plugin update.

One curious thing is that the same pipeline does work if a I run it againts feature/myfeature o develop branches. But if it is for a Pull Request from feature/myfeature → develop, it does not work.

The error that I’m getting is this one:

##[error]ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR:
ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR:
##[error]The SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]02:41:04.948 Post-processing failed. Exit code: 1
02:41:04.948 Post-processing failed. Exit code: 1
##[error]The process ‘/usr/bin/dotnet’ failed with exit code 1

My prepare task look like this:

- task: SonarCloudPrepare@1
  displayName: 'Prepare analysis on SonarCloud'
  inputs:
    SonarCloud: SonarCloud
    organization: myOrganization
    scannerMode: 'MSBuild'
    projectKey: 'api.key'
    projectName: API     

Also, I try to set sonar.login (token) as a extraProperties without a luck.

Any idea?

Thanks in advance.

Hi @AngelTorquemada , welcome to the community.

I would check if your Azure personal access token is still valid.

You can go to “Administration” menu, then “Organization setting”, at your org level to check that.

HTH,

1 Like

Hello Mickaël

That did the trick, I forgot about the token to link Azure DevOps Services Organization with the Sonarcloud, I was just aware of the token of the Service connection.

Thanks :smiley:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.