Skip to content

[Bug]: Azure DevOps pull requests never show profile pictures #24355

Open

Description

@Tabonx

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Sign in to Azure CLI with the DevOps extension (az login or az devops login).
  2. Add a project whose remote is an Azure DevOps repository.
  3. Open its pull requests on web, desktop, or mobile.

Expected behavior

Authors and reviewers show their Azure DevOps profile pictures, as GitHub authors do.

Actual behavior

No Azure DevOps author or reviewer ever shows a picture. Web and desktop show the first letter of the name. Mobile shows an empty space where the avatar should be.

The adapter passes Azure's imageUrl straight to the client, for example https://dev.azure.com/acme/_api/_common/identityImage?id=<guid>. That URL only answers a signed-in browser session. A request without one gets a 302 to the Visual Studio sign-in page, so the <img> fails. With a bearer token from az account get-access-token, the same URL returns 200 image/png.

Impact

Cosmetic issue

Version or commit

main @ b24e8ce

Environment

macOS, Azure CLI with the azure-devops extension, T3 Code web and iOS dev client

Activity

  1. Tabonx commented on Nov 20, 2026

    @Tabonx
    ContributorAuthor

    Written by Claude Opus 5.5 for Pavel Kroupa.

    Update: a URL rewrite fixes this, no proxy needed

    On v0.1.11, Azure DevOps avatars show in the Issues view but not in pull requests. Both render through the same PullRequestActorAvatar, and the server passes Azure's imageUrl through unchanged in both cases. The difference is the URL Azure returns.

    Source URL Azure returns Anonymous request
    Work item fields (System.AssignedTo and others) https://dev.azure.com/<org>/_apis/GraphProfile/MemberAvatars/aad.<base64url> 200 image/png
    PR createdBy and reviewers https://dev.azure.com/<org>/_api/_common/identityImage?id=<guid> 302 to the sign-in page
    Team members (az devops team list-member, Issues assignee picker) https://dev.azure.com/<org>/_api/_common/identityImage?id=<guid> 302 to the sign-in page

    MemberAvatars needs no credential at all. I checked it with plain curl against a real organization:

    • It accepts the bare identity GUID. MemberAvatars/<guid> returns the same bytes as MemberAvatars/<descriptor>, for authors and for reviewers. That matters because reviewers come back with descriptor: null (156 of 156 in one project), while authors carry one. With the GUID form, no lookup is needed for either.
    • It works on dev.azure.com/<org> and <org>.visualstudio.com, and GUID case does not matter.
    • Images are 0.3 to 6.5 KB at the default size. ?size=2 returns 115 to 130 KB, so keep the default.
    • An unknown GUID, a team, or a group returns 404. The client then shows the initial, as it does today for every Azure avatar.
    • The endpoint is undocumented. Azure itself puts it in work item payloads, and the Issues view already depends on it, so the fix adds no new dependency.
    • The response sends Cache-Control: no-cache, no-store, so the browser refetches each time. At a few KB per avatar that is fine.

    Proposed fix

    Add one helper in packages/source-control-azure-devops that rewrites <origin>/_api/_common/identityImage?id=<guid> to <origin>/_apis/GraphProfile/MemberAvatars/<guid>. Leave any other URL as it is. Use it where the adapter reads imageUrl today:

    Plus a unit test for the rewrite. Contracts, web, mobile, and desktop stay as they are. Only the server changes, and because the client loads the image straight from Azure, it works the same in local, remote, and tunnel connections.

    Relation to #24357

    #24357 fixes this by fetching the avatar on the server with two az devops invoke calls, caching it, and serving it through fetchMedia and a signed /api/assets URL. It builds on the host media hooks from #23994 and makes cwd optional in the source control media contract. The rewrite above makes all of that unnecessary, so I plan to close #24357 once this lands.

    Version: v0.1.11, checked against main @ 898c22f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions