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