Skip to main content

Notifications

Power Automate - Building Flows
Answered

How to upload a Microsoft 365 group's photo?

Like (0) ShareShare
ReportReport
Posted on 14 Jan 2025 10:44:11 by 8
I want to replicate the photo from one M365 group to another.
I've been able to get the photo using a graph GET call to https://graph.microsoft.com/v1.0/groups/<id of source group>/photo/$value.
 
However, I did not found a way to upload the image to the target group.
 
According the documentation, I should be able to make a PUT or a PATCH call to https://graph.microsoft.com/v1.0/groups/<id of target group>/photo/$value with the picture content as body.
 
This API is working well from external tools, but not from power automate.
 
Here's what I currently have:
 
body is the output of "Get source group Image".
The create file action is here to check if my picture is valid. Which it is, I can see the image is properly saved to some SharePoint site.
 
 
When running, the "set target group image" fails with this output (HTTP 400):
 
{
  "error": {
    "code": "InvalidImage",
    "message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileBadRequestException' was thrown.",
    "innerError": {
      "date": "2025-01-14T10:40:11",
      "request-id": "d73494a5-d1b4-4b92-8e22-0359642961ef",
      "client-request-id": "d73494a5-d1b4-4b92-8e22-0359642961ef"
    }
  }
}


How to fix my workflow ?
 
I tried to played with intermediate compose action, with binary() and/or base64toBinary()... without success.
 
Thanks
 
 
  • palsecam Profile Picture
    palsecam 8 on 14 Jan 2025 at 14:34:30
    How to upload a Microsoft 365 group's photo?
    Great @Expiscornovus!
     
    I missed this specific variation of HTTP request action.
     
    Still wondering why the original implementation failed, but at least I solve my issue.
     
    Thanks!
  • Verified answer
    Expiscornovus Profile Picture
    Expiscornovus 31,008 on 14 Jan 2025 at 14:14:09
    How to upload a Microsoft 365 group's photo?
     
    Ok, good to know that requirement.
     
    Have you tried the Send an HTTP request V2 action of the Office 365 Groups connector? That action should work with the /groups endpoint.

    ​​​​​​​


    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel
  • palsecam Profile Picture
    palsecam 8 on 14 Jan 2025 at 13:56:21
    How to upload a Microsoft 365 group's photo?
    Thanks @expiscornovus.
     
    PUT and PATCH, same behavior.
     
    I use the HTTP with Microsoft Entra ID (preauthorized) action and not the HTTP because of the authentication. Because of the extra requirements to enable OAuth (need to authenticate using certificate on SP endpoints, which must be protected, ...) we ban the HTTP action (we are ISV and we can't ask too much complexity to customers).
     
    I also tried with various "HTTP actions" from others builtin connectors (teams, outlook, office 365, ...) but none is set up to allow /groups endpoint.
  • Expiscornovus Profile Picture
    Expiscornovus 31,008 on 14 Jan 2025 at 13:17:13
    How to upload a Microsoft 365 group's photo?
     
    Have you tried the PUT method instead? Does that also give you the error?
     
    And which specific action are you using? The HTTP with Microsoft Entra ID (preauthorized) action?
     
    I tried to reproduce your issue with the HTTP action, but seems to work fine with the PUT method.
     
    Below was my test setup, if that helps? (I also have OAuth config in both actions, which is not in the screenshot).
     

    Test result

    ​​​​​​​

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,593

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,403

Leaderboard
Loading started
Loading complete