PR Decoration and Comments Not Showing in Azure DevOps Despite Correct Setup

Hi SonarCloud Community,

I am experiencing an issue where pull request (PR) decoration and comments are not appearing in Azure DevOps, even though the setup appears to be correct. Here are the details:

  • The Azure DevOps repository is linked to the SonarCloud project.
  • The project has PR decoration enabled with Azure DevOps as the provider.
  • A Personal Access Token (PAT) with the required scopes (Code and Pull Requests) is configured and used in the pipeline.
  • PR triggers are correctly defined in our YAML pipeline (pr.branches.include).
  • The sonar.projectKey, sonar.organization, and sonar.login are properly set via sonar-project.propertiesor extraProperties.
  • The PR analysis runs successfully, and results show up in SonarCloud — but the decoration is not posted back to the Azure DevOps PR.

Can you please help investigate why PR decoration is not working?

Any update ? @ganncamp

Hi,

Welcome to the community!

I invite you to familiarize yourself with the FAQ, and in particular this section:

I created a topic, when can I expect a response?

This is an open community with people volunteering their free time to provide assistance. We’re eager to contribute to the community, but you are not guaranteed a fast response.

Be patient

  • Wait a few days before bumping a topic that hasn’t received a response.

As well as this section:

What is @name mentioning? Should I do it?

@name mentioning is when you type someone’s username with an @ preceding it. Doing this sends a notification to the user. Depending on their settings, it may also send them an email message.

In general, it is considered bad form to @name mention someone not already engaged in the conversation. Please don’t do it.

Regarding your question, are you missing PR decoration across your organization or only for one or two projects?

 
Thx,
Ann

Apologies for name mentioned

The issue is with PR decoration across my organization

Hi,

And has PR decoration ever worked? If so, then it’s likely that your PAT expired.

 
HTH,
Ann

Checked PAT no issues with PAT

I used cURL to hit ADO and its working fine

I tried full access & Code READ/Write token both are good & working

I am using full access one

1 Like

Hi,

Has decoration ever worked? Or has it been this way since you set up your organization?

 
Thx,
Ann

No its not worked ever..

I dont see any RED/Green Icon in PR list ADO also comments are not getting added after analysis completed to PR back as well

Hi,

Thanks for confirming that. I’ve flagged this for more expert eyes.

 
Ann

I can provide PR ID from SonarCloud if required to check on your side

1 Like

Hi,

Organization, project and PR IDs would all be very helpful.

 
Thx,
Ann

How can I share it privately?

can’t share it publicly, can you guide how I can share in private due to security concern??

Thanks

Hi,

No worries. I’ve flagged this for the experts. They’ll contact you.

 
Ann

In your PAT token permissions in Azure DevOps:

Visit following link and sign in:
https://dev.azure.com/[org]/_usersSettings/tokens
Try enabling the following options. You need to click on custom defined.

I would also extend expiry date to longest time in the future based on your requirements while you are there.

Hope this helps.




Edit: I see you have previously had full access on PAT token with no luck. When you get decoration working you can reduce the scope to these options.

Not sure if this helps but we run our Sonarcloud pipeline from the branch poilcies.

In branches within DevOps select policy:

Run your Sonarcloud pipeline from here as part of the PR. Maybe this will help if you haven’t done this already.

Hi Andy,

I already added Token with Full Access

1 Like

Can I have screenshot of PR decoration how it looks likes in the ADO PR list or in the branch section…

I follow this extension and his documentation and as seen in this documentation whenever the sonar quality failed it shows green or red dot as per the quality, which is not showing in my case.

My branch policy works but I want indication like above screen shot, also cant sonar add comments in PR how to enable it for all projects?

any update??