# Azure DevOps Publish Quality Gate Result v6 Failing with MS Hosted Agents

**URL:** <https://community.sonarsource.com/t/azure-devops-publish-quality-gate-result-v6-failing-with-ms-hosted-agents/127873>\
**Category:** SonarQube Server / Community Build\
**Created:** [October 11, 2024, 12:37am UTC](https://community.sonarsource.com/t/azure-devops-publish-quality-gate-result-v6-failing-with-ms-hosted-agents/127873 "2024-10-11T00:37:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcahill](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pcahill](https://community.sonarsource.com/u/pcahill)\
**Post date:** [October 11, 2024, 12:37am UTC](https://community.sonarsource.com/t/azure-devops-publish-quality-gate-result-v6-failing-with-ms-hosted-agents/127873/1 "2024-10-11T00:37:34Z")

</div>

SonarQube version: 9.9.1  
Azure DevOps “Publish Quality Gate Result” task version: 6.3.2  
Azure DevOps Agent Pool: MS Hosted (windows-latest)

In Azure DevOps pipelines, getting the following error when running **v6** of the “Publish Quality Gate Result” task on the **MS Hosted agents** :

```auto
##[error][SQ] API GET '/api/metrics/search' failed, error is Unexpected token < in JSON at position 0
##[warning]Error while executing SonarQube:Publish task: Could not fetch metrics
##[error]Could not fetch metrics
Finishing: SonarQubePublish

```

- Runs successfully when using **self-hosted/on-prem agents** and **v6 of the SonarQube tasks**
- It also runs successfully on the **MS Hosted agents** when using **v5 of the SonarQube tasks**.

---

<div class="post-metadata">

**Author:** ![pcahill](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pcahill](https://community.sonarsource.com/u/pcahill)\
**Post date:** [October 22, 2024, 9:46pm UTC](https://community.sonarsource.com/t/azure-devops-publish-quality-gate-result-v6-failing-with-ms-hosted-agents/127873/5 "2024-10-22T21:46:02Z")

</div>

This error went away in the new 7.x version of the pipeline task.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [October 30, 2024, 11:26am UTC](https://community.sonarsource.com/t/azure-devops-publish-quality-gate-result-v6-failing-with-ms-hosted-agents/127873/7 "2024-10-30T11:26:22Z")

</div>

Closed on October 30, 2024, 11:26am UTC

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