How to display user profile pictures in a chatbot application using Azure services?

Dinnemidi Ananda Kumar 60 Reputation points
2024-04-18T09:45:11.9733333+00:00

I have developed a chatbot application using Azure Storage Account, Azure AI Search, and Azure Open AI. When I run my code, it opens a web chat application where users can ask questions related to the provided data. This chatbot application is intended for internal use within my organization.

I would like to display the profile picture of the logged-in user at the top of the chatbot application. The profile pictures of my company employees are already stored in Azure Microsoft Azure AD.

Could you please guide me on how to achieve this? Specifically, I would like to know how to retrieve the user's profile picture from Azure AD and display it in the chatbot application's UI.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,205 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sreeju Nair 12,361 Reputation points
    2024-04-18T11:29:55.83+00:00

    You can use the graph API to retrieve the profile photo.

    Refer: https://learn.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0&tabs=http

    The profile photo can be retrieved by users with a minimum of "Contacts. Read" Permission. Since it is an internal application, I believe, users are authenticated with Azure AD, and they will be able to call Get profile photo API.

    Hope this helps

    0 comments No comments

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.