Right now, when you use siteLogoUrl in the spo site set command, it changes the thumbnail, not the actual logo of the site. Looking at the command's inner workings, it seems the body sent to _api/siteiconmanager/setsitelogo is missing a few things. With some tweaks to this endpoint, we should be able to modify the thumbnail and the logo as well. Let's add another option and adjust the command a bit.
| Option |
Description |
--siteThumbnailUrl [siteThumbnailUrl] |
Set the thumbnail for the site collection. This can be an absolute or relative URL to a file on the current site collection. |
The request options for _api/siteiconmanager/setsitelogo should look like this:
const requestOptions: CliRequestOptions = {
url: `${args.options.url}/_api/siteiconmanager/setsitelogo`,
headers: {
accept: 'application/json;odata=nometadata'
},
data: {
aspect: 0,
relativeLogoUrl: thumbnailUrl,
type: 0
},
responseType: 'json'
};
const requestOptions: CliRequestOptions = {
url: `${args.options.url}/_api/siteiconmanager/setsitelogo`,
headers: {
accept: 'application/json;odata=nometadata'
},
data: {
aspect: 1,
relativeLogoUrl: logoUrl,
type: 0
},
responseType: 'json'
};
Right now, when you use
siteLogoUrlin thespo site setcommand, it changes the thumbnail, not the actual logo of the site. Looking at the command's inner workings, it seems the body sent to_api/siteiconmanager/setsitelogois missing a few things. With some tweaks to this endpoint, we should be able to modify the thumbnail and the logo as well. Let's add another option and adjust the command a bit.--siteThumbnailUrl [siteThumbnailUrl]The request options for
_api/siteiconmanager/setsitelogoshould look like this: