Project Not Found when running code analyze in Azure Devops Pipeline

Template for a good new topic, formatted with Markdown:

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used when applicable: SonarCloud Analyze Task
  • Languages of the repository: Typescript
  • Only if the SonarCloud project is public, the URL: Private project
  • Error observed
ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator

Hi I have set up a private project in SonarCloud and linked with Azure Devops Repo.
In Azure devops pipeline, I want to do code analyze with SonarCloudAnalyze task but it always failed with an error message Project not found. I have double checked the projectKey and service connection between Azure devops server with SonarCloud and it seems have no issue. So why scanner can’t find the private project in SonarCloud? Thanks for your answer.

I’m glad that we are not the only having this issue.
In my case, it’s only failing when in a PR context. In other case, it’s working.

You have to generate a new token in azure devops and force it into the organization. It solved the issue for us.

1 Like