Puzzlepart / prosjektportalen

Prosjektportal for SharePoint er et prosjektstyringsverktøy for SharePoint basert på prosjektveiviseren
Other
30 stars 16 forks source link

Add support for remote provisioning of pnp files in github/pp/releases #115

Closed pettersh closed 7 years ago

pettersh commented 7 years ago

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your needs please complete the below template to ensure we have the details to help. Thanks!

Category

[x] Enhancement

[ ] Bug

[ ] Question

Environment

[x] SharePoint Online [x] SharePoint 2013

Summary

Consider adding pnp packages to the releases (not wrapped in zip files) to support remote provisioning, and also ease integration from Azure Functions, WebJobs and other hosted provisioning code.

Example:

Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/projects Apply-PnPProvisioningTemplate -Path https://github.com/Puzzlepart/prosjektportalen/archive/v1.11.4.pnp

This approach may also ease automated deployments and release management (of non-customized deployments)

Version

Please specify what version ou are using: [ ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

If you are reporting an issue please describe the expected behavior. If you are suggesting an enhancement please describe thoroughly the enhancement, how it can be achieved, and expected benefit. If you are asking a question, ask away!

Observed Behavior

If you are reporting an issue please describe the behavior you expected to occur when performing the action. If you are making a suggestion or asking a question delete this section.

Steps to Reproduce

If you are reporting an issue please describe the steps to reproduce the bug in sufficient detail to allow testing. If you are making a suggestion or asking a question delete this section.

olemp commented 7 years ago

Love this idea, @pettersh.

We might have to do a PR though since I get the following error when attempting to apply a template residing on GitHub.

Apply-PnPProvisioningTemplate : The remote server returned an error: (422) Unprocessable Entity.

cc @tarjeieo

olemp commented 7 years ago

I think that currenly the pnp file must reside in a SharePoint library.

Any input on this @wobba?

wobba commented 7 years ago

Right now it tries to load the file as an SPFile. It could try to load using a http request. Easiest would be to use default credentials for a user, as more complex auth scenarios quickly becomes complicated.

The easy workaround is to fetch the file from github first, then apply from the local copy.

Invoke-WebRequest -UseBasicParsing -Uri https://server/pathv1.11.4.pnp -OutFile v1.11.4.pnp
Apply-PnPProvisioningTemplate -Path ./v1.11.4.pnp
olemp commented 7 years ago

Thanks @wobba.

What do you think @pettersh? Is this good enough?

olemp commented 7 years ago

The pnp files can be added to the release (example : https://github.com/Puzzlepart/prosjektportalen/releases/tag/v1.13.0)

And then you'll do this if you want to apply the root template:

Invoke-WebRequest -UseBasicParsing -Uri https://github.com/Puzzlepart/prosjektportalen/releases/download/v1.13.0/root.pnp -OutFile root_v1.13.0.pnp
Apply-PnPProvisioningTemplate .\root_v1.13.0.pnp
pettersh commented 7 years ago

Good enough for now @olemp

pettersh commented 7 years ago

Good enough for now @olemp

tarjeieo commented 7 years ago

I don't like this approach, as it only creates confusion about what files to download. When is this ever useful? I think we should remove them.

olemp commented 7 years ago

That makes sense @tarjeieo

The releases become quite messy.