We are running 9.9 version and using azure pipeline.
Recently had a token expire for our project, after creating a new project token we are getting 401 errors for Publish Quality Gate Result. When we created the the token we were running an older version (sorry I don’t remember it). Am I missing some sort of permission setting? this was working before the the token expired.
Task : Publish Quality Gate Result
Description : Publish SonarQube's Quality Gate result on the Azure DevOps build result, to be used after the actual analysis.
Version : 5.2.0
Author : sonarsource
Help : Version: 5.2.0. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
##[error][SQ] Could not fetch metrics
##[error][SQ] API GET '/api/metrics/search' failed, status code was: 401
##[error][SQ] API GET '/api/ce/task' failed, status code was: 401
##[error][SQ] Could not fetch task for ID 'AYsfJ_j5-fN3XT_GHcKH'
Normally your build engine has a technical user that has global admin permissions, so if your
user has admin permissions its user token should work - either for analysis of any project or using the web api like i.e.
I would recheck if it’s really a user token for an Sonarqube admin user.
I see maybe we had it setup wrong? We are/were passing a project token to the pipeline to authenticate. So it is best to create a user token for the Admin user and use that instead? or at least a user that has full privileges.
Question why would the user token work over just the project analyiss token
I will definitely give it a try right now, we implemented each project with its own project token that is how we have been running if for a year now. they have their own pipelines too so they each call the secret separately.
I get why most of these post end with no resolution… so my embarrassing ending I forgot to check the service connection. So that has our new token in it now too and we seem to be past this issue. Thank you Gilbert