Description
Priority
(Low) Something is a little off
Description
You can currently only set a site logo and site thumbnail from the same site with m365 spo site.
My use case is to have a common site logo and site thumbnail for multiple sites that is loaded fom a single site. This is technically possible with _api/siteiconmanager.
Steps to reproduce
Run the following command and examine the POST queries sent to _api/siteiconmanager
m365 spo site set -u https://contoso.sharepoint.com/sites/team-b --siteLogoUrl https://contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png --siteThumbnailUrl https://contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png --debug
Expected results
I should be able to set a site logo and site thumbnail and they should be set as
/sites/team-a/SiteAssets/logo.png
Actual results
The site logo and site thumbnail are set as
/sites/team-b/https://contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png
Diagnostics
Executing command spo site set with options {"options":{"url":"https://contoso.sharepoint.com/sites/team-b","siteLogoUrl":"https://contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png","siteThumbnailUrl":"https://contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png","debug":true,"output":"json"}}
Executing command as '[email protected]', appId: IAMAVALIDAPPID, tenantId: IAMAVALIDTENANTID
SPO Tenant ID previously retrieved IAMAVALIDTENANTID;Tenant. Returning...
SPO URL previously retrieved https://contoso.sharepoint.com. Returning...
Existing access token IAMAVALIDTOKEN still valid. Returning...
Request:
{
"url": "https://contoso-admin.sharepoint.com/_api/contextinfo",
"method": "post",
"headers": {
"Accept": "application/json;odata=nometadata",
"user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/10.5.0",
"accept-encoding": "gzip, deflate",
"X-ClientService-ClientTag": "M365CLI:10.5.0",
"authorization": "Bearer IAMAVALIDTOKEN"
},
"responseType": "json",
"decompress": true
}
Response:
{
"url": "https://contoso-admin.sharepoint.com/_api/contextinfo",
"status": 200,
"statusText": "OK",
"headers": {
"cache-control": "private, max-age=0",
"transfer-encoding": "chunked",
"content-type": "application/json;odata=nometadata;=true;charset=utf-8",
"expires": "Wed, 02 Apr 2025 06:55:31 GMT",
"last-modified": "Thu, 17 Apr 2025 06:55:31 GMT",
"vary": "Origin,Accept-Encoding",
"p3p": "CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"",
"x-networkstatistics": "0,4194720,0,17,790733,394906,394906,19882",
"x-sharepointhealthscore": "3",
"x-sp-serverstate": "ReadOnly=0",
"dataserviceversion": "3.0",
"spclientservicerequestduration": "21",
"x-aspnet-version": "4.0.30319",
"isocdi": "0",
"x-databoundary": "EU",
"x-1dscollectorurl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
"x-ariacollectorurl": "https://eu-mobile.events.data.microsoft.com/Collector/3.0",
"sprequestguid": "4d4b95a1-a071-c000-73a6-2f81c59a19dc",
"request-id": "4d4b95a1-a071-c000-73a6-2f81c59a19dc",
"ms-cv": "oZVLTXGgAMBzpi+BxZoZ3A.0",
"strict-transport-security": "max-age=31536000",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
"x-powered-by": "ASP.NET",
"microsoftsharepointteamservices": "16.0.0.26002",
"x-content-type-options": "nosniff",
"x-ms-invokeapp": "1; RequireReadOnly",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: 4A93904CEE684BC5B31FC6B52252D285 Ref B: STOEDGE1722 Ref C: 2025-04-17T06:55:31Z",
"date": "Thu, 17 Apr 2025 06:55:30 GMT"
},
"data": {
"FormDigestTimeoutSeconds": 1800,
"FormDigestValue": "0x7580CFDAE7523E0EDEA8421098B2C72E0CCB87E9BDA39AC09298A01D3B6B21B8FACAAA0A8044D10259593FE1B182E55DE8C2E3C4B8709C84279C3D7A5D6DDC5C,17 Apr 2025 06:55:31 -0000",
"LibraryVersion": "16.0.26002.12006",
"SiteFullUrl": "https://contoso-admin.sharepoint.com",
"SupportedSchemaVersions": [
"14.0.0.0",
"15.0.0.0"
],
"WebFullUrl": "https://contoso-admin.sharepoint.com"
}
}
Loading site IDs...
Existing access token IAMAVALIDTOKEN still valid. Returning...
Request:
{
"url": "https://contoso.sharepoint.com/sites/team-b/_api/site?$select=GroupId,Id",
"method": "get",
"headers": {
"Accept": "application/json;odata=nometadata",
"user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/10.5.0",
"accept-encoding": "gzip, deflate",
"X-ClientService-ClientTag": "M365CLI:10.5.0",
"authorization": "Bearer IAMAVALIDTOKEN"
},
"responseType": "json",
"decompress": true
}
Response:
{
"url": "https://contoso.sharepoint.com/sites/team-b/_api/site?$select=GroupId,Id",
"status": 200,
"statusText": "OK",
"headers": {
"cache-control": "private, max-age=0",
"transfer-encoding": "chunked",
"content-type": "application/json;odata=nometadata;=true;charset=utf-8",
"expires": "Wed, 02 Apr 2025 06:55:31 GMT",
"last-modified": "Thu, 17 Apr 2025 06:55:31 GMT",
"vary": "Origin,Accept-Encoding",
"p3p": "CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"",
"x-networkstatistics": "0,4194720,0,0,683384,250009,250009,19825",
"x-sharepointhealthscore": "1",
"x-sp-serverstate": "ReadOnly=0",
"dataserviceversion": "3.0",
"spclientservicerequestduration": "19",
"x-aspnet-version": "4.0.30319",
"isocdi": "0",
"x-databoundary": "EU",
"x-1dscollectorurl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
"x-ariacollectorurl": "https://eu-mobile.events.data.microsoft.com/Collector/3.0",
"sprequestguid": "4d4b95a1-907f-c000-73a6-2be5bd97b614",
"request-id": "4d4b95a1-907f-c000-73a6-2be5bd97b614",
"ms-cv": "oZVLTX+QAMBzpivlvZe2FA.0",
"strict-transport-security": "max-age=31536000",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
"x-powered-by": "ASP.NET",
"microsoftsharepointteamservices": "16.0.0.26002",
"x-content-type-options": "nosniff",
"x-ms-invokeapp": "1; RequireReadOnly",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: FCA998E1616B46DBA84540221F1ECC5A Ref B: STOEDGE1013 Ref C: 2025-04-17T06:55:31Z",
"date": "Thu, 17 Apr 2025 06:55:30 GMT"
},
"data": {
"GroupId": "00000000-0000-0000-0000-000000000000",
"Id": "cdec1314-c3d1-4676-801a-39b9efa092df"
}
}
Retrieved site IDs. siteId: cdec1314-c3d1-4676-801a-39b9efa092df, groupId: 00000000-0000-0000-0000-000000000000
Site is not group connected
Setting the site its logo...
Existing access token IAMAVALIDTOKEN still valid. Returning...
Request:
{
"url": "https://contoso.sharepoint.com/sites/team-b/_api/siteiconmanager/setsitelogo",
"method": "post",
"headers": {
"Accept": "application/json;odata=nometadata",
"user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/10.5.0",
"accept-encoding": "gzip, deflate",
"X-ClientService-ClientTag": "M365CLI:10.5.0",
"authorization": "Bearer IAMAVALIDTOKEN"
},
"responseType": "json",
"decompress": true,
"data": {
"aspect": 1,
"relativeLogoUrl": "/sites/team-b/https:/contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png",
"type": 0
}
}
Response:
{
"url": "https://contoso.sharepoint.com/sites/team-b/_api/siteiconmanager/setsitelogo",
"status": 200,
"statusText": "OK",
"headers": {
"cache-control": "private, max-age=0",
"transfer-encoding": "chunked",
"content-type": "application/json;odata=nometadata;=true;charset=utf-8",
"expires": "Wed, 02 Apr 2025 06:55:31 GMT",
"last-modified": "Thu, 17 Apr 2025 06:55:31 GMT",
"vary": "Origin,Accept-Encoding",
"p3p": "CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"",
"x-networkstatistics": "0,4194567,0,0,834387,298928,298928,19867",
"x-sharepointhealthscore": "1",
"x-sp-serverstate": "ReadOnly=0",
"dataserviceversion": "3.0",
"spclientservicerequestduration": "75",
"x-aspnet-version": "4.0.30319",
"isocdi": "0",
"x-databoundary": "EU",
"x-1dscollectorurl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
"x-ariacollectorurl": "https://eu-mobile.events.data.microsoft.com/Collector/3.0",
"sprequestguid": "4d4b95a1-e086-c000-73a6-26483ca411c4",
"request-id": "4d4b95a1-e086-c000-73a6-26483ca411c4",
"ms-cv": "oZVLTYbgAMBzpiZIPKQRxA.0",
"strict-transport-security": "max-age=31536000",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
"x-powered-by": "ASP.NET",
"microsoftsharepointteamservices": "16.0.0.26002",
"x-content-type-options": "nosniff",
"x-ms-invokeapp": "1; RequireReadOnly",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: 02D3BAB024CE4119AC74292979439043 Ref B: STOEDGE1013 Ref C: 2025-04-17T06:55:31Z",
"date": "Thu, 17 Apr 2025 06:55:30 GMT"
},
"data": {
"odata.null": true
}
}
Setting the site thumbnail...
Existing access token IAMAVALIDTOKEN still valid. Returning...
Request:
{
"url": "https://contoso.sharepoint.com/sites/team-b/_api/siteiconmanager/setsitelogo",
"method": "post",
"headers": {
"Accept": "application/json;odata=nometadata",
"user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/10.5.0",
"accept-encoding": "gzip, deflate",
"X-ClientService-ClientTag": "M365CLI:10.5.0",
"authorization": "Bearer IAMAVALIDTOKEN"
},
"responseType": "json",
"decompress": true,
"data": {
"aspect": 0,
"relativeLogoUrl": "/sites/team-b/https:/contoso.sharepoint.com/sites/team-a/SiteAssets/logo.png",
"type": 0
}
}
Response:
{
"url": "https://contoso.sharepoint.com/sites/team-b/_api/siteiconmanager/setsitelogo",
"status": 200,
"statusText": "OK",
"headers": {
"cache-control": "private, max-age=0",
"transfer-encoding": "chunked",
"content-type": "application/json;odata=nometadata;=true;charset=utf-8",
"expires": "Wed, 02 Apr 2025 06:55:31 GMT",
"last-modified": "Thu, 17 Apr 2025 06:55:31 GMT",
"vary": "Origin,Accept-Encoding",
"p3p": "CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"",
"x-networkstatistics": "0,4194567,0,0,683679,252073,252073,19818",
"x-sharepointhealthscore": "2",
"x-sp-serverstate": "ReadOnly=0",
"dataserviceversion": "3.0",
"spclientservicerequestduration": "93",
"x-aspnet-version": "4.0.30319",
"isocdi": "0",
"x-databoundary": "EU",
"x-1dscollectorurl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
"x-ariacollectorurl": "https://eu-mobile.events.data.microsoft.com/Collector/3.0",
"sprequestguid": "4d4b95a1-1092-c000-73a6-2849d8f22175",
"request-id": "4d4b95a1-1092-c000-73a6-2849d8f22175",
"ms-cv": "oZVLTZIQAMBzpihJ2PIhdQ.0",
"strict-transport-security": "max-age=31536000",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
"x-powered-by": "ASP.NET",
"microsoftsharepointteamservices": "16.0.0.26002",
"x-content-type-options": "nosniff",
"x-ms-invokeapp": "1; RequireReadOnly",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: 60166E6646DE4C77AA5D8786D22C4958 Ref B: STOEDGE1013 Ref C: 2025-04-17T06:55:31Z",
"date": "Thu, 17 Apr 2025 06:55:30 GMT"
},
"data": {
"odata.null": true
}
}
DONE
Timings:
api: 881.850453ms
core: 14.079571ms
command: 886.657376ms
options: 0.226501ms
total: 902.606056ms
validation: 0.655804ms
CLI for Microsoft 365 version
10.5.0
nodejs version
22
Operating system (environment)
Linux
Shell
bash
cli doctor
No response
Additional Info
This is an issue how the relative urls are parsed. Additionally I noticed that the siteLogoUrl and siteThumbnailUrl are parsed differently if you are giving the urls as relative parameters. In my example I'm using absolute parameters to keep the issue simple.
Already have a fix for this issue. Will create a PR shortly.