How to display user's photo in adaptive card with Microsoft Graph?

Sally Chen 145 Reputation points Microsoft External Staff
2025-01-02T08:55:57.25+00:00

Hi,

I am creating a Teams Message Extension. I want to know how to display the user's photo on the adaptive card. The photo is retrieved from Microsoft Graph like this: https://graph.microsoft.com/v1.0/users/${id}/photo/$value

The part of adaptive card is as follows:


"type": "ColumnSet",

"columns": [

    {

    "type": "Column",

    "items": [

        {

        "type": "Image",

        "url": "path/to/photo",

        "altText": "profileImage",

        "size": "Small",

        "style": "Person"

        }

    ],

    "width": "auto"

    }
]

Thank you!

Microsoft Teams | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prasad-MSFT 8,981 Reputation points Microsoft External Staff Moderator
    2025-01-02T11:22:05.2+00:00

    People icon helps to view the images of users in an Adaptive Card. You can insert an image and apply all the properties supported on images. People icon is supported in Teams mobile and desktop clients.

    There are two types of people icons that are supported in an Adaptive Card:

    • Persona: If you want to show a single user in an Adaptive Card, it displays the people icon and the name of the user.
    • Persona Set: If you want to show multiple users in an Adaptive Card, it displays only the people icon of the users.

    Ref: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cdesktop%2Cdesktop1%2Cdesktop2%2Cconnector-html#people-icon-in-an-adaptive-card

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.   


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.