Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Update user profilephoto from CDS to AD - using Graph Api

(0) ShareShare
ReportReport
Posted on by 98

Hello Folks,

 

The aim is to update a user profile photo stored in CDS (PowerApps) to the Active Directory using Graph API - and for that I am using Flow.

 

1. To get the image from CDS - I am using the [Get file or image content] action - in the output we are getting the image content.

 

fmourtaza_0-1603176151990.png

 

2. thereafter converting the content into base64 for further processing with Graph Api. The processing of the Compose action is successful, however when we see the output, the end of the string is not properly closed/formatted.  

 

fmourtaza_1-1603176313409.png

 

fmourtaza_2-1603176403628.png

 

3. The next step would be to update the AD using Graph Api hence using the HTTP action - but its failing with a HTTP Failed error - I feel its because of the length of the content.

fmourtaza_4-1603176773925.png

 

fmourtaza_3-1603176734454.png

 

Any clue how can I overcome this ? or another approach to update the user profile photo to the AD ?

 

Regards.

  • fmourtaza Profile Picture
    98 on at
    Re: Update user profilephoto from CDS to AD - using Graph Api

    Hi @FCGALLEG 

     

    The error is a generic one Action 'HTTP' Failed

     

    The screenshot is shared on the initial post or you can click the below link

     

    https://powerusers.microsoft.com/t5/Using-Flows/Update-user-profilephoto-from-CDS-to-AD-using-Graph-Api/m-p/728234?lightbox-message-images-723221=189769i6152ACFD6C8CDA03#M18706

     

     

  • Javier Gallego Profile Picture
    on at
    Re: Update user profilephoto from CDS to AD - using Graph Api

    Hi fmourtaza,

     

    Do you have any error?

    Could you share it with us?

     

    Thanks

    Javier

     

  • fmourtaza Profile Picture
    98 on at
    Re: Update user profilephoto from CDS to AD - using Graph Api

    Hi @FCGALLEG 

     

    Thanks for your comments, however it didn't work for other users - it seems this action works only for the user owning the flow - any idea on how to impersonate the flow or its action ? 

     

     

  • Javier Gallego Profile Picture
    on at
    Re: Update user profilephoto from CDS to AD - using Graph Api

    Hi fmourtaza ,

     

    Thanks for sharing the solution.

     

    Regards,

    JAvier

  • Verified answer
    fmourtaza Profile Picture
    98 on at
    Re: Update user profilephoto from CDS to AD - using Graph Api

    The solution was given in one of the previous post - thanks to @EricRegnier 

     

    A simple method to update the images is via Power Automate with the O365 connector. Here's a template:https://emea.flow.microsoft.com/en-us/galleries/public/templates/514fe3a191cd47d5ac0ab273cbf0a773/update-my-office-365-profile-picture-with-a-button-click/

     

    This works nicely.

     

    fmourtaza_0-1603179146291.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow