Open PieterVeenstra opened 8 years ago
Hi, I am trying to create site columns and content types in clean Office 365 root site using PnP PowerShell but getting below error.
Apply-SPOProvisioningTemplate : Access denied. You do not have permission to perform this action or access this resource.
The error occurs only on root site. If I execute this command on any other site with URL containing \sites\ in it then it works fine.
Please let me know how can I resolve this.
Hi Pieter, Can I assume that this issue has been fixed by the commit referenced above? Thanks.
As there was a type mismatch between schema and code in core I am not sure if this was ever fully fixed. I will need to double check if that commit was accepted or not
Ok, please let me know when you have time. Thanks.
While waiting for you to confirm that the bug is fully solved, I will close this item. Please, feel free to ping me back to re-open it. Thanks.
Hi paola,
I had the same yesterday where the style library gave access denied on update. I removed the library from the template manually as a quick work around
Ok, I just reopened it. Thanks.
So the issue seems to be related to use not properly handling the DraftVersionVisibility on a style library?
I've just come across this problem again. when using a clean tenant from demos.microsoft.com.
It looks like where the code does a list.Update() on the Style Library the next ExecuteQueryRetry is failing. even though no changes are made to the list within the PnP Code (or did I miss something). Maybe we should include the list.Update into the IsDirty section.
I ran into the same bug today in the September version, so still an issue.
I've got a clean Office 365 tenant and I've exported the root site that is created by default. Then I reimported template I'm getting:
[ERROR] Apply-SPOProvisioningTemplate : Access denied. You do not have permission to perform [ERROR] this action or access this resource. [ERROR] At line:1 char:1 [ERROR] + Apply-SPOProvisioningTemplate -Path d:\test.xml [ERROR] +
~~~~~~~~~~~~ [ERROR] + CategoryInfo : WriteError: (:) [Apply-SPOProvisioningTemplate], ServerUn [ERROR] authorizedAccessException [ERROR] + FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.Branding.Apply [ERROR] ProvisioningTemplate [ERROR]When I stepped through the code I noticed that DraftVersionVisibility is being set.
Looking at my template file: