Reputation: 1
Here we can update logo by this url https://graph.microsoft.com/v1.0/applications/application-id/logo.
But I want update the logo using Microsoft Patch API while creating the application using Microsoft graph api. Because Users need to pass image url sometimes . I found this document https://learn.microsoft.com/en-us/graph/tutorial-applications-basics?tabs=http . Here we can update the logo by using image URL. Also I read in place logoUrl we need to pass CDN image links only.
JSON payload is
{
"info": {
"logoUrl": "https://cdn.pixabay.com/photo/2016/03/21/23/25/link-1271843_1280.png",
"marketingUrl": "https://www.contoso.com/app/marketing",
"privacyStatementUrl": "https://www.contoso.com/app/privacy",
"supportUrl": "https://www.contoso.com/app/support",
"termsOfServiceUrl": "https://www.contoso.com/app/termsofservice"
}
}
It is given 204 content status All other fields are updated . But logo not uploaded in azure application.
Upvotes: 0
Views: 166
Reputation: 22432
According to this MS Doc, you need to use PUT query to update the logo. You cannot update it with
info/logoUrl
as it is read-only based on informationalUrl resource type.
I have registered one Azure AD application named GraphApp
with below properties:
To update above properties, I ran below PATCH
request and got response like this:
PATCH https://graph.microsoft.com/v1.0/applications/<appObjectID>/
{
"info": {
"logoUrl": "https://cdn.pixabay.com/photo/2016/03/21/23/25/link-1271843_1280.png",
"marketingUrl": "https://www.contoso.com/app/marketing",
"privacyStatementUrl": "https://www.contoso.com/app/privacy",
"supportUrl": "https://www.contoso.com/app/support",
"termsOfServiceUrl": "https://www.contoso.com/app/termsofservice"
}
}
Response:
When I checked the same in Portal, all properties updated except logo like this:
To update logo, you need to use PUT
method by adding image in binary stream along with Content-Type
header like below:
PUT https://graph.microsoft.com/v1.0/applications/<appObjectID>/logo
Authorization:Bearer <access_token>
Content-Type:image/png
Response:
When I checked the same in Portal, logo uploaded successfully to the application like below:
Reference: Set the logo for an Azure Application using Microsoft Graph - Stack Overflow by MattJeanes
Upvotes: 0