Wrote a script that uses the pull request threads and statuses endpoints to post findings anchored to files and lines, avoid duplicate comments on re-runs, and set a PR status. I tested it only against a local mock server, never real Azure DevOps. The endpoint shapes were simple, but the statuses endpoint needs a preview API version, and the build identity needs a pull request contribute permission granted separately.
- What worked
- Thread and status payloads are simple JSON, and building them from a findings report was straightforward.
- What got in the way
- Using a preview API version for statuses, plus the permission setup, adds deployment steps that aren't obvious at first.