Run Code Analysis step is failing for msbuild sonarcloud

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarcloud

  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    1_Agent job 1.txt (832.1 KB)

  • steps to reproduce

  • potential workaround

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

hi @gdeep and welcome to the community

as you probably read yourself in the logs

2020-04-28T10:29:02.5691835Z ##[error]ERROR: Error during SonarQube Scanner execution
2020-04-28T10:29:02.5693145Z ERROR: Error during SonarQube Scanner execution
2020-04-28T10:29:02.5693993Z ##[error]ERROR: You're not authorized to run analysis. Please contact the project administrator.
2020-04-28T10:29:02.5694892Z ERROR: You're not authorized to run analysis. Please contact the project administrator.
2020-04-28T10:29:02.5695967Z ##[error]ERROR:
2020-04-28T10:29:02.5696613Z ERROR: 
2020-04-28T10:29:02.6344572Z ##[error]The SonarQube Scanner did not complete successfully
2020-04-28T10:29:02.6345843Z The SonarQube Scanner did not complete successfully
2020-04-28T10:29:02.6386976Z ##[error]10:29:02.625  Post-processing failed. Exit code: 1

You’re not authorized to run analysis. Please contact the project administrator.

It seems to be a problem of permissions.

I am using same credentials in my other pipelines , they are working fine.
One thing which I notice, the project for which this error is ocurring does not open completely if visual studio is not opened in admin mode.
Do we need to make changes to the msbuild as well?

I don’t know, that seems really something specific to your application…

If you run the analysis from the Administrator account, does it work?

also, given the error message You're not authorized to run analysis. - are you sure you are providing the correct sonar.login ? You may want to generate a token and use that for the analysis - see the docs.