Created a build definition in TFS 2018
Add step Prepare analysis on SonarQube. 3 Tokenizer: Transform Source Files
NuGet Restore
Build Solution: .NET
VsTest - testAssemblies
Run Code Analysis
Publish Quality Gate Result
Step 8 Fails with below error:
Evaluating condition for step: 'Publish Quality Gate Result'
Evaluating: succeeded()
Evaluating succeeded:
(Boolean) True
Expanded: True
Result: True
Starting: Publish Quality Gate Result
============================================================================== 2018-06-04T17:34:41.6970611Z Task : Publish Quality Gate Result 2018-06-04T17:34:41.6971068Z Description : Publish SonarQube's Quality Gate result on the VSTS/TFS build result, to be used after the actual analysis. 2018-06-04T17:34:41.6971496Z Version : 4.2.0 2018-06-04T17:34:41.6971818Z Author : sonarsource 2018-06-04T17:34:41.6972216Z Help : More Information 2018-06-04T17:34:41.6972761Z ==============================================================================
agent.TempDirectory=D:\source\agent\_work\_temp
loading inputs and endpoints
loading
ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
loading INPUT_POLLINGTIMEOUTSEC
loading SECRET_SONARQUBE_ENDPOINT
loaded 5
Agent.ProxyUrl=undefined
Agent.CAInfo=undefined
Agent.ClientCert=undefined
Agent.SkipCertValidation=undefined
SONARQUBE_SCANNER_PARAMS={"sonar.host.url":"http://localhost:9000/","sonar.login":"admin","sonar.password":"admin","sonar.projectKey":"nao-webapi","sonar.projectName":"nao-webapi","sonar.projectVersion":"1.0","sonar.cs.vscoveragexml.reportsPaths":"**/*.coveragexml","sonar.verbose":"true"}
SONARQUBE_ENDPOINT=********
API GET: '/api/metrics/search' with query "{"f":"name","ps":500}"
Response: 401 Body: "undefined"
API GET '/api/metrics/search' failed, status code was: 401
Could not fetch metrics
Processed: ##vso[task.issue type=error;][SQ] Could not fetch metrics
API GET '/api/metrics/search' failed, status code was: 401
Processed: ##vso[task.issue type=error;][SQ] API GET '/api/metrics/search' failed, status code was: 401
Agent.BuildDirectory=D:\source\agent\_work\21
defaultRoot: 'D:\source\agent\_work\21'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
matchOptions.debug: 'false'
I get the results, can't figure out why this is not working.