0

If I have this example static site: https://github.com/Azure-Samples/app-service-web-html-get-started

How do I get this visible as a static site in my office365 online sharepoint.

I can successfully upload it to the "Shared Documents" Folder... but I read here Aspx page not opening in SharePoint online Modern Team site that this is the incorrect place?

How can I go about doing this using only the PnP Powershell API? (I currently can do this: but can't view the html or aspx)

    Add-PnPFile -Path "test.aspx" `
             -Folder "/sites/MySite/Shared Documents" `
             -Connection $myConnection
0

As per the link you cited, there are only a few places you can upload an .aspx file where it will execute and display the file as a page.

Of the locations enumerated in your cited link, I would suggest the Style Library.

Add-PnpFile -Path “C:\<Local Path to file>\test.aspx” -Folder “/sites/MySite/Style Library/“ -Connection $MyConnection

This will upload the file to the Style Library in that site. If the file already exists, it will be overwritten.

Please mark as Answer if this solved your problem.

2
  • It's giving me "Add-PnPFile: Access denied.".... is there a way to check permissions from CLI using PnP ?
    – Ryu S.
    Sep 24 '21 at 17:18
  • @RyuS. You need to have adequate permissions on the site you are running the command against. Sep 25 '21 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.