pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
415 stars 642 forks source link

"Skipping upload of file" when provisioning a file to Communication site #1612

Open chjohan opened 6 years ago

chjohan commented 6 years ago

Category

[x] Bug [ ] Enhancement

Environment

[x] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013

Expected or Desired Behavior

I'm trying to provision an .aspx file to SitePages in a communication site using the 2018/01 schema version and 2.23.1802.0 PnP-Powershell version.

Observed Behavior

When running Apply-PnPProvisioningTemplate -Path .\template.xml -Handlers Files, the tracelog outputs:

PowerShell_ISE.exe Warning: 0 : 2018-02-23 12:37:02.5438    [Files] [17]    [Information]   Skipping upload of file 'Files\BestillTeam.aspx' to '/SitePages'.   655ms   46de95a0-5af5-
4a6c-95a2-966877815205

Applying the same template to a team site works fine.

Steps to Reproduce

  1. Create a new communication site
  2. Connect to site Connect-PnPOnline -Url https://yourdomain.sharepoint.com/sites/yoursite
  3. Create a provisioning template containing the Files property: `

    </pnp:Files>`

  4. Create a folder named "Files" in the directory containing your template.xml.
  5. Create a file named BestillTeam.aspx located in the newly created "Files" directory.
  6. Run Apply-PnPProvisioningTemplate -Path .\template.xml -Handlers Files
TeodoraI commented 6 years ago

Hi @chjohan, It appears that you don't have scripting enabled in your site. When the scripting is not enabled the aspx files are not allowed and cannot be uploaded. For more information check this articles: https://support.office.com/en-us/article/security-considerations-of-allowing-custom-script-b0420ab0-aff2-4bbc-bf5e-03de9719627c https://support.office.com/en-us/article/types-of-files-that-cannot-be-added-to-a-list-or-library-30be234d-e551-4c2a-8de8-f8546ffbf5b3#ID0EAABAAA=Online