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

Dinnemidi Ananda Kumar 140 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 in Foundry Models

Answer accepted by question author
Sreeju Nair 12,761 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

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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