SOLVED

CSOM - Web Property Bag on Root Tenant site issue

%3CLINGO-SUB%20id%3D%22lingo-sub-44788%22%20slang%3D%22en-US%22%3ECSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-44788%22%20slang%3D%22en-US%22%3E%3CP%3EHey!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20a%20post%20to%20inform%20that%20there%20is%20a%20bug%20(or%20maybe%20a%20feature%3F)%20where%20you%20cannot%20modify%20property%20bag%20values%20on%20root%20tenant%20site.%20For%20example%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcompany.sharepoint.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcompany.sharepoint.com%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEven%20as%20a%20global%20administrator%20you%20will%20receive%20'access%20denied'%20message%20when%20trying%20to%20do%20so.%20JSOM%2C%20CSOM%2C%20nothing%20actually%20works.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20will%20be%20resolved%20in%20some%20future%3B%20right%20now%20you%20have%20to%20fallback%20and%20use%20normal%20list%20to%20store%20sensitive%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-44788%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExtensibility%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75157%22%20slang%3D%22en-US%22%3ERe%3A%20CSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75157%22%20slang%3D%22en-US%22%3EThanks%2C%20I%20have%20actually%20resolved%20the%20issue%2C%20but%20forgot%20to%20reply.%20In%20fact%2C%20you%20are%20100%25%20right.%20I%20found%20this%20out%20myself%20when%20I%20run%20into%20strange%20issues%20with%20image%20rendition.%20It%20turns%20out%20that%20those%20things%20are%20connected%2C%20so%20if%20you%20are%20reading%20this%20because%20of%20image%20rendition%20issues%20-%20ENABLE%20scripting%20capabilities!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-53942%22%20slang%3D%22en-US%22%3ERe%3A%20CSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-53942%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20behaviour%20is%20because%20the%20%22The%20Root%20Site%20Collection%20of%20the%20Tenant%22%20%3CSPAN%3Ehave%20scripting%20capabilities%20disabled%20(it's%20a%20so-called%20NoScript%20site).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20you%20need%20to%20be%20able%20to%20update%20the%20property%20bag%20for%20the%20web%20then%20you%20can%20enable%20the%20same%20on%20the%20site.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERefer%20to%20the%20following%20Microsoft%20support%20article%20for%20details%20on%20enabling%20this%20functionality%20for%20the%20Root%20Site%20Collection%20of%20the%20Tenant.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CA%20title%3D%22Turn%20scripting%20capabilities%20on%20or%20off%22%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FTurn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETurn%20scripting%20capabilities%20on%20or%20off%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-45143%22%20slang%3D%22en-US%22%3ERe%3A%20CSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-45143%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20guys%20for%20answers.%20Actually%20I%20have%20tried%20it%20on%20two%20different%20tenants%2C%20and%20received%20the%20same%20results.%3CBR%20%2F%3EBasically%2C%20when%20running%20my%20JSOM%20%26amp%3B%20CSOM%20scripts%20on%3CBR%20%2F%3E%26gt%3B%26gt%3B%20%3CA%20href%3D%22https%3A%2F%2Fsometenant.sharepoint.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsometenant.sharepoint.com%2F%3C%2FA%3E%3CBR%20%2F%3EIt%20ends%20with%20error.%3CBR%20%2F%3EHowever%20on%3CBR%20%2F%3E%26gt%3B%26gt%3B%20%3CA%20href%3D%22https%3A%2F%2Fsometenant.sharepoint.com%2Fsharepoint%2Fsites%2Fsome_site_collection%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsometenant.sharepoint.com%2Fsharepoint%2Fsites%2Fsome_site_collection%3C%2FA%3E%3CBR%20%2F%3EThe%20script%20inserts%20property%20bag%20without%20any%20issues.%20Note%20that%20my%20account%20have%20global%20admin%20%26amp%3B%20site%20collection%20administrator%20rights%20(in%20both%20cases).%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20a%20proof%2C%20see%20image%3A%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fi.imgur.com%2F6C1hU5N.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fi.imgur.com%2F6C1hU5N.png%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAnyway%2C%20I%20have%20contacted%20Microsoft%20support%20through%20the%20o365%20admin%20panel%2C%20hope%20this%20is%20correct%20way%20to%20request%20a%20ticket.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-45008%22%20slang%3D%22en-US%22%3ERe%3A%20CSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-45008%22%20slang%3D%22en-US%22%3E%3CP%3EHave%20you%20tried%20SP%20DEV%20tools%20extension%20for%20Chrome%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Fchrome-sp-dev-tools%2Fefhiadiopfkjpdihdmlccoffnpdblkho%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Fchrome-sp-dev-tools%2Fefhiadiopfkjpdihdmlccoffnpdblkho%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20nopt%20have%20any%20modern%20sites%20in%20my%20prod%20tenant%20to%20try%20this%20one%2C%20but%20the%20tools%20lets%20you%20get%20to%20the%20web%20property%20bag%20and%20edit%20them%20if%20you%20have%20permissions.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eworth%20a%20shot.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-45001%22%20slang%3D%22en-US%22%3ERe%3A%20CSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-45001%22%20slang%3D%22en-US%22%3EWeird.%20I%20haven't%20had%20that%20issue.%20However%2C%20I've%20read%20that%20with%20Modern%20team%20sites%2C%20you%20cannot%20Access%20or%20Update%20property%20bags%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Fpnp_articles%2Fmodern-experience-customizations-customize-sites%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Fpnp_articles%2Fmodern-experience-customizations-customize-sites%3C%2FA%3E%3CBR%20%2F%3ENot%20sure%20if%20it%20can%20be%20related%20somehow.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-44995%22%20slang%3D%22en-US%22%3ERe%3A%20CSOM%20-%20Web%20Property%20Bag%20on%20Root%20Tenant%20site%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-44995%22%20slang%3D%22en-US%22%3E%3CP%3Ehave%20not%20run%20into%20this%20issue%20yet%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hey!

 

Just a post to inform that there is a bug (or maybe a feature?) where you cannot modify property bag values on root tenant site. For example:

https://company.sharepoint.com

 

Even as a global administrator you will receive 'access denied' message when trying to do so. JSOM, CSOM, nothing actually works.

 

Hope this will be resolved in some future; right now you have to fallback and use normal list to store sensitive data.

6 Replies
Highlighted

have not run into this issue yet

Highlighted
Weird. I haven't had that issue. However, I've read that with Modern team sites, you cannot Access or Update property bags:
https://msdn.microsoft.com/en-us/pnp_articles/modern-experience-customizations-customize-sites
Not sure if it can be related somehow.
Highlighted

Have you tried SP DEV tools extension for Chrome? 

 

https://chrome.google.com/webstore/detail/chrome-sp-dev-tools/efhiadiopfkjpdihdmlccoffnpdblkho 

 

I do nopt have any modern sites in my prod tenant to try this one, but the tools lets you get to the web property bag and edit them if you have permissions. 

 

worth a shot. 

Highlighted

Thanks guys for answers. Actually I have tried it on two different tenants, and received the same results.
Basically, when running my JSOM & CSOM scripts on
>> https://sometenant.sharepoint.com/
It ends with error.
However on
>> https://sometenant.sharepoint.com/sharepoint/sites/some_site_collection
The script inserts property bag without any issues. Note that my account have global admin & site collection administrator rights (in both cases).

For a proof, see image:
http://i.imgur.com/6C1hU5N.png

Anyway, I have contacted Microsoft support through the o365 admin panel, hope this is correct way to request a ticket.

Highlighted
Solution

This behaviour is because the "The Root Site Collection of the Tenant" have scripting capabilities disabled (it's a so-called NoScript site).

 

If you need to be able to update the property bag for the web then you can enable the same on the site.

 

Refer to the following Microsoft support article for details on enabling this functionality for the Root Site Collection of the Tenant.

Turn scripting capabilities on or off

Highlighted
Thanks, I have actually resolved the issue, but forgot to reply. In fact, you are 100% right. I found this out myself when I run into strange issues with image rendition. It turns out that those things are connected, so if you are reading this because of image rendition issues - ENABLE scripting capabilities!