Giter Site home page Giter Site logo

pnp / pnpframework Goto Github PK

View Code? Open in Web Editor NEW
205.0 17.0 143.0 59.12 MB

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions

Home Page: https://pnp.github.io/pnpframework/

License: MIT License

C# 98.20% CSS 0.01% ASP.NET 0.46% HTML 1.26% PowerShell 0.07%
pnp-framework pnp-provisioning-engine csharp dotnetstandard hacktoberfest dotnet6 dotnet7

pnpframework's Introduction

PnP Framework

PnP Framework is a .NET Standard 2.0 / .NET 6.0 / .NET 7.0 / .NET 8.0 library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions. This library is the cross platform successor of the PnP-Sites-Core library. The original PnP-Sites-Core library only works on Windows (due to the dependency on .Net Framework) and supports SharePoint on-premises and SharePoint Online, while this library will work cross platform but only supports SharePoint Online. Going forward we'll only be actively maintaining PnP Framework, the PnP-Sites-Core library is retired and archived.

Next to PnP Framework that will be replacing PnP-Sites-Core we're also building a brand new PnP Core SDK that targets modern .NET development and which will work everywhere where .NET will run. This library is the long term evolution of PnP Framework, we'll enable a phased transition from PnP Framework to PnP Core SDK without impacting PnP Framework users.

Getting started

Pull down the latest version of PnP Framework here:

Nuget package Description Latest release Latest nightly development version
PnP.Framework The PnP Framework library PnP.Framework Nuget package PnP.Framework Nuget package

Migrating from PnP Sites Core

This library is the cross platform successor of the PnP-Sites-Core, see the Migrating from PnP Sites Core to PnP Framework guide to learn how to switch over.

I've found a bug, where do I need to log an issue or create a PR

Issues and PR's need to be created in the PnP Framework repo, the PnP Sites Core repo has been archived.

Supportability and SLA

This library is open-source and community provided component with active community providing support for it. This is not Microsoft provided component so there's no SLA or direct support for this open-source component from Microsoft. Please report any issues using the issues list.

Building and contributing

To build PnP Framework you need the following minimal components installed:

Contributions should be made against the dev branch of the repository.

Community rocks, sharing is caring!

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

pnpframework's People

Contributors

actions-user avatar czullu avatar danielpastoor avatar erwinvanhunen avatar fzbm avatar gautamdsheth avatar heinrich-ulbricht avatar jackpoz avatar jansenbe avatar joaocruz2001 avatar kevmcdonk avatar koenzomers avatar koskila avatar leonarmston avatar magarma avatar mijensen avatar mmi-wp avatar nikomix avatar nils-a avatar ohaak2 avatar paolopia avatar patrikhellgren avatar pkbullock avatar robi26 avatar sebastianmattar avatar stevewinward avatar vesajuvonen avatar wilecoyotegenius avatar wobba avatar yannickre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pnpframework's Issues

Where is/equivalent to Microsoft.SharePoint.Client.TenantExtensions.GetOneDriveSiteCollections?

We decided to take an early plunge and try to port our codebase over to PNP Framework (from 3.17.2001.2). We have the following code:

tenant.GetOneDriveSiteCollections();

This uses the mentioned extension method in the "old" PnP-Sites-Core. Is this an intentional change / omission, how to properly replace this? (is there a Wiki/something else with "breaking changes" or "you should use y instead of x going forward"?)

<pnp:SiteCollection /> wait time

As the creation of a site collection by default calls WaitForProvisioningIsComplete with 80 retries and 15 seconds between each try, I would suggest to add a new attribute "Wait = true/false" to <pnp:SiteCollection /> element https://github.com/SharePoint/PnP-Sites-Core/blob/c09e0f0590aada578d6b958b532b396e044ffcd4/Core/OfficeDevPnP.Core/Sites/SiteCollection.cs#L510

This would give the same control to the user that New-PnPSite -Wait switch paramater gives (it's still confusing to people upgrading from PnP September 2019 to November 2019+ that what took a few seconds before now can take up to 20 minutes)

Invalid data has been used to update the list item with pnp:ClientSidePage

I am trying to deploy a page template as part of my provisioning template, however when I create a new instance of the the page template after provisioning a new site, am getting this error:

Invalid data has been used to update the list item. The field you are trying to update may be read only.

I have a page content type that inherits from Site Page, with no additional columns, deployed with my provisioning template, its ID is:
0x0101009D1CB255DA76424F860D91F20E6C411800CDB5E46C6094554D9A67815F1F98AB89

First, I have prepared everything in the site using the browser. I created a content type inheriting from "Site Page", then created a new page using this content type, and saved it as a template. The page template works fine in the original site when I try to create new instances, so I used Get-PnPProvisioningTemplate

The ClientSidePage XML looks like this, it gives me the error above, if I remove the ContentTypeID from the XML, it works fine:


<pnp:ClientSidePage PromoteAsNewsArticle="false" PromoteAsTemplate="true" Overwrite="true" Title="Custom Page Template" ContentTypeID="0x0101009D1CB255DA76424F860D91F20E6C411800CDB5E46C6094554D9A67815F1F98AB89" ThumbnailUrl="" PageName="Templates/MyPageTemplate.aspx">
          <pnp:Header Type="Custom" ServerRelativeImageUrl="https://{fqdn}{site}/SiteAssets/custom/banner.jpg" TranslateX="51.7085751128304" TranslateY="42.1052631578947" LayoutType="FullWidthImage" TextAlignment="Center" ShowTopicHeader="false" ShowPublishDate="false" TopicHeader="" AlternativeText="" Authors="[]" AuthorByLine="[]" AuthorByLineId="-1" />
          <pnp:Sections>
            <pnp:Section Order="1" Type="OneColumn">
              <pnp:Controls>
                <pnp:CanvasControl WebPartType="Text" ControlId="9d15f343-b007-415c-b6e7-580e81dc234e" Order="1" Column="1">
                  <pnp:CanvasControlProperties>
                    <pnp:CanvasControlProperty Key="Text" Value="Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur" />
                  </pnp:CanvasControlProperties>
                </pnp:CanvasControl>
                <pnp:CanvasControl WebPartType="ImageGallery" JsonControlData="{&quot;id&quot;: &quot;af8be689-990e-492a-81f7-ba3e4cd3ed9c&quot;, &quot;instanceId&quot;: &quot;76f685e6-c4f4-43b9-ab85-e0670b668c3d&quot;, &quot;title&quot;: &quot;Page Template&quot;, &quot;description&quot;: &quot;Using page template description&quot;, &quot;dataVersion&quot;: &quot;1.8&quot;, &quot;properties&quot;: {&quot;layout&quot;:4,&quot;carouselSettings&quot;:{&quot;autoplay&quot;:false,&quot;autoplaySpeed&quot;:5,&quot;dots&quot;:false,&quot;lazyLoad&quot;:true,&quot;metadata&quot;:true,&quot;swipe&quot;:true},&quot;gridSettings&quot;:{&quot;imageSize&quot;:2,&quot;imageCropping&quot;:1,&quot;imageAspectRatio&quot;:1,&quot;lightbox&quot;:false},&quot;imageSourceType&quot;:1,&quot;isRecursive&quot;:false,&quot;isCdnEnabledForList&quot;:false,&quot;hasDynamicModeEnabled&quot;:false,&quot;maxImagesCount&quot;:10,&quot;images&quot;:[],&quot;canAlwaysSelectDocLibAsSource&quot;:false,&quot;layoutComponentId&quot;:&quot;&quot;}, &quot;serverProcessedContent&quot;: {&quot;htmlStrings&quot;:{},&quot;searchablePlainTexts&quot;:{},&quot;imageSources&quot;:{},&quot;links&quot;:{}}, &quot;dynamicDataPaths&quot;: {}, &quot;dynamicDataValues&quot;: {}}" ControlId="af8be689-990e-492a-81f7-ba3e4cd3ed9c" Order="2" Column="1" />
              </pnp:Controls>
            </pnp:Section>
          </pnp:Sections>
</pnp:ClientSidePage>

My Content Type that is included in the template looks like this:

<pnp:ContentType ID="0x0101009D1CB255DA76424F860D91F20E6C411800CDB5E46C6094554D9A67815F1F98AB89" Name="Custom CT" Description="" Group="Custom" NewFormUrl="" EditFormUrl="" DisplayFormUrl="">
          <pnp:FieldRefs>
            <pnp:FieldRef ID="c042a256-787d-4a6f-8a8a-cf6ab767f12d" Name="ContentType" UpdateChildren="true" />
            <pnp:FieldRef ID="5f47e085-2150-41dc-b661-442f3027f552" Name="SelectFilename" UpdateChildren="true" />
            <pnp:FieldRef ID="8553196d-ec8d-4564-9861-3dbe931050c8" Name="FileLeafRef" Required="true" UpdateChildren="true" />
            <pnp:FieldRef ID="8c06beca-0777-48f7-91c7-6da68bc07b69" Name="Created" Hidden="true" UpdateChildren="true" />
            <pnp:FieldRef ID="fa564e0f-0c70-4ab9-b863-0177e6ddd247" Name="Title" UpdateChildren="true" />
            <pnp:FieldRef ID="28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f" Name="Modified" Hidden="true" UpdateChildren="true" />
            <pnp:FieldRef ID="822c78e3-1ea9-4943-b449-57863ad33ca9" Name="Modified_x0020_By" UpdateChildren="true" />
            <pnp:FieldRef ID="4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb" Name="Created_x0020_By" UpdateChildren="true" />
            <pnp:FieldRef ID="82642ec8-ef9b-478f-acf9-31f7d45fbc31" Name="LinkTitle" UpdateChildren="true" />
            <pnp:FieldRef ID="7efc33c1-b56b-490e-9c9b-1097e971ba96" Name="ClientSideApplicationId" UpdateChildren="true" />
            <pnp:FieldRef ID="daef58d7-ccfd-43fc-b776-2e292cc66bba" Name="PageLayoutType" UpdateChildren="true" />
            <pnp:FieldRef ID="4966388e-6e12-4bc6-8990-5b5b66153eae" Name="CanvasContent1" UpdateChildren="true" />
            <pnp:FieldRef ID="5baf6db5-9d25-4738-b15e-db5789298e82" Name="BannerImageUrl" UpdateChildren="true" />
            <pnp:FieldRef ID="fb3259ac-bd07-4397-b7aa-03e885b0838e" Name="BannerImageOffset" UpdateChildren="true" />
            <pnp:FieldRef ID="3f155110-a6a2-4d70-926c-94648101f0e8" Name="Description" UpdateChildren="true" />
            <pnp:FieldRef ID="f5ad16a2-85be-46b2-b5f0-2bb8b4a5074a" Name="PromotedState" UpdateChildren="true" />
            <pnp:FieldRef ID="c84f8697-331e-457d-884a-c4fb8f30ea74" Name="FirstPublishedDate" UpdateChildren="true" />
            <pnp:FieldRef ID="261075db-0525-4fb8-a6ea-772014186599" Name="LayoutWebpartsContent" UpdateChildren="true" />
            <pnp:FieldRef ID="1a7348e7-1bb7-4a47-9790-088e7cb20b58" Name="_AuthorByline" UpdateChildren="true" />
            <pnp:FieldRef ID="d60d65ff-ff42-4044-a684-ac3f7a5e598c" Name="_TopicHeader" UpdateChildren="true" />
            <pnp:FieldRef ID="9de685c5-fdf5-4319-b987-3edf55efb36f" Name="_SPSitePageFlags" UpdateChildren="true" />
          </pnp:FieldRefs>
          <pnp:DocumentTemplate TargetName="/_layouts/15/CreateSitePage.aspx" />
</pnp:ContentType>

Whenever I create a new page out of this page template that's connected to this content type, it gives me the reported error.

More examples about provisioning..

I spent few hours trying to make the provisioning template works, most of the examples aren't for the "sequence" part where you can provision sites, and the ones provided focus on Teams.

I would like to create new communication sites using the templates, however whenever I do:

connect-pnponline "mysite"

and then apply-provisioningtemplate .. it is applied to the site I connected to in the first step, it's not applied to the site I am having in my provisioning template. Are there any examples and tutorials on how to create new sites? I saw the samples in the provisioning engine, but they all show the .xml nothing shows what I need to do from the Powershell side of things. Is it correct to use connect-pnponline [anysite] ?

thanks.

Transforming from Non-Microsoft Data Sources

Category

[ ] Bug
[X] Enhancement

Details

I'd like to start looking at designing/writing this. I have a large client with a old CMS Cold Fusion based, that hosts between 7-12 Intranets and various other sites. I am currently creating a series of modern intranets as a replacement. Most calls where the client asks if the content can be moved, I am faced with providing bad news. Id like to change that.

Design Approach

Outline features to include:

  • (1) A extraction utility designed to connect to the various data sources, extensible (I'm guessing that overtime a series of these will be required for each data source etc, e.g. WordPress, Drupal, Custom) to produce the common file and extract the assets.
  • (2) Common File Format as the input source, to contain everything the transformation tool needs to process the content
  • Include Assets, Docs and Images
  • Set of supported web parts e.g. Image, Text, Links as the common ones, much like the wiki is handled to start with and grow as requirements come in.
  • Extraction Utility perhaps performs the HTML scrubbing, extensible, AngleSharp based
  • New mode in the tool, so separate classes etc. for clean separation with support for XML based data sources e.g. no source SharePoint connection.

I will see if I am permitted to grab some HTML/Screenshot samples for test cases and analysis.
I saw a demo once of PowerBi Desktop can extract content from a site, there maybe some learnings here (or code to pinch ;-))

Just wondering what your thoughts are, or if you have a better approach.

RFC - Remove classic features going forward

With this PnP Framework being SPO only and Microsoft investing heavily in Modern sites like communication and team sites, the classic sites (like publishing sites, enterprise wiki, classic team site etc.) even though not deprecated will not be actively receiving new features and investment from Microsoft.

It would now make sense that we too as a community move towards the new Modern direction.

Would like to propose that, we start by removing classic features (list below) used in these classic sites from the provisioning engine. This will make it easier for us concentrate on enhancing and adding new capabilities without getting bogged down by "legacy/classic" stuff. It will make the engine better, smaller and faster.

List of features , I would propose that we remove from the engine:

  1. Provision classic workflows.
  2. Provision publishing/wiki/webpart pages (classic pages).
  3. Provision Image renditions , not needed in modern sites.
  4. Provision composed looks , not needed in modern sites.
  5. Provision property bag, not supported in modern sites.

Some reasons :

2010 classic workflows are already deprecated, 2013 workflows also based on legacy tech. Microsoft is heavily investing in PowerAutomate and PowerApps and the low-code platform. So, would make sense to add support for them in the engine whenever there are APIs available for that.

For Publishing/Wiki/Webpart pages, we have the excellent PnP Modernization tooling which helps you move the classic pages to modern pages.

Image renditions, property bag are not supported in the modern sites. Yes, you can provision property bag but for that you need to modify site collection property and then make the change. Similar thing for Composed looks, it is now replaced by the new Fluent UI based themes, we already support them via the engine

Would love to hear your feedback and comments on this. The above list is not exhaustive, there are also certain extensions we looked at which are using the classic capabilities which simply wont work in the modern sites.

If folks agree on this, happy to pick this task up.

The library is in preview and not supported for production use, so breaking changes are easier to accomplish now before this goes GA , so really appreciate any inputs on this.

SiteGroup ClearExistingItems attr. not respect

Category

  • Bug

Describe the bug

As described in this PR pnp/PnP-Provisioning-Schema#386, it is now possible to create additional
SharePoint groups. But the ClearExistingItems attribute does not appear to be respected on these groups (<pnp:Members ClearExistingItems="true"> tag). But works as expected on the default Owners, Members and Visitors groups.

But I think a there are missing a call to ClearExistingUsers around line 379, https://github.com/pnp/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectSiteSecurity.cs#L379

#Steps to Reproduce

  1. Apply this PnPProvisioningTemplate to the site
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
  <pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.22.2006.2, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-94F2A9FBD42A4426A711EFE6606EE94E">
    <pnp:ProvisioningTemplate ID="TEMPLATE-94F2A9FBD42A4426A711EFE6606EE94E" Version="1" BaseSiteTemplate="STS#3" Scope="RootSite">
      <pnp:Security AssociatedOwnerGroup="TEST Owners" AssociatedMemberGroup="TEST Members" AssociatedVisitorGroup="TEST Visitors">
        <pnp:SiteGroups>
          <pnp:SiteGroup Title="Power Users" Description="Group of Power Users" Owner="[email protected]">
            <pnp:Members ClearExistingItems="true">
              <pnp:User Name="[email protected]" />
            </pnp:Members>
          </pnp:SiteGroup>
        </pnp:SiteGroups>
      </pnp:Security>
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>
  1. Change user1 to user2 like this and re provisioning the template :
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
  <pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.22.2006.2, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-94F2A9FBD42A4426A711EFE6606EE94E">
    <pnp:ProvisioningTemplate ID="TEMPLATE-94F2A9FBD42A4426A711EFE6606EE94E" Version="1" BaseSiteTemplate="STS#3" Scope="RootSite">
      <pnp:Security AssociatedOwnerGroup="TEST Owners" AssociatedMemberGroup="TEST Members" AssociatedVisitorGroup="TEST Visitors">
        <pnp:SiteGroups>
          <pnp:SiteGroup Title="Power Users" Description="Group of Power Users" Owner="[email protected]">
            <pnp:Members ClearExistingItems="true">
              <pnp:User Name="[email protected]" />
            </pnp:Members>
          </pnp:SiteGroup>
        </pnp:SiteGroups>
      </pnp:Security>
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>

Expected or Desired Behavior

Both user1 and user2 is now a member of the Power Users group. But expected result is that only user2 should be the remaining member.

Add Markdown Template Provider

I've been looking at a way to get a friendly way of viewing a PnP template as a document of a site. After trying out a few ways of manipulating the XML but feel that getting it out as a TemplateProvider would be a great way and then have pnppowershell allowing .md files as an -Out format.

Before I go too far down that path of that in a fork, would that likely to be accepted as a PR?

I am thinking of having a set of Writers similar to the XmlSerializers that would build up a TextWriter object. That would then be pushed out in the stream for ToFormattedTemplate.

Column Formatting not included for _ModerationStatus (Approval Status)

Hi,

On a document library with Content Approval enabled you will get a few new columns such as the Approval Status (_ModerationStatus). Adding Column Formatting on this column I have found that the JSON is not included in the generated PnP Template XML.

<pnp:FieldRef ID="fdc3b2ed-5bf2-4835-a4bc-b885f3396a61" Name="_ModerationStatus" Required="true" DisplayName="Approval Status" />

On a field which I have created the custom formatting is included in the CustomFormatter section.

Provisioning Teams team does not accept parameter for Visibility property

Trying to pass a parameter via a template to the Visibility property of a team gives an error. Seems that the parameter is not resolved. All other properties work well.

Example:
<pnp:Team GroupId="{sequencesitegroupid:TEAMSITE01}" DisplayName="{parameter:Title}" Description="{parameter:Description}" Visibility="{parameter:Visibility}" MailNickname="{parameter:Alias}">

Error:
ERROR: The 'Visibility' attribute is invalid - The value '{parameter:Visibility}' is invalid according to its datatype 'String' - The Enumeration constraint failed.
[2020-12-08T13:28:36.693Z]
[2020-12-08T13:28:36.694Z] Exception :
[2020-12-08T13:28:36.695Z] Type : System.Xml.Schema.XmlSchemaValidationException
[2020-12-08T13:28:36.695Z] Message : The 'Visibility' attribute is invalid - The value '{parameter:Visibility}' is invalid according to its datatype 'String' - The Enumeration constraint failed.
[2020-12-08T13:28:36.696Z] InnerException :
[2020-12-08T13:28:36.697Z] Type : System.Xml.Schema.XmlSchemaException
[2020-12-08T13:28:36.698Z] Message : The Enumeration constraint failed.
[2020-12-08T13:28:36.699Z] HResult : -2146231999
[2020-12-08T13:28:36.712Z] HResult : -2146231999
[2020-12-08T13:28:36.713Z] CategoryInfo : SyntaxError: (:) [Invoke-PnPTenantTemplate], XmlSchemaValidationException
[2020-12-08T13:28:36.714Z] FullyQualifiedErrorId : TEMPLATENOTVALID,PnP.PowerShell.Commands.Provisioning.Tenant.InvokeTenantTemplate

sequencesitegroupid token missing

Hi,

Maybe a question and not a bug:
Has the sequencesitegroupid token been removed? When trying to use it with the preview nugget package in .NET core it doesn't seem to get resolved.
When trying with PnP PowerShell core, the token seems to be resolved.

<pnp:Team GroupId="{sequencesitegroupid:TEAM.SITE.01}" ....

image

Check "Enable pages and news to be translated" with provisioning engine

Is there a way to have the option "enable pages and news to be translated into multiple languages" by default within the provisioning engine? I know about the supported languages element in the xml schema, but this will not enable this option by default.

Is there a PnP Powershell cmdlet to enable it?

Duplicate field name was found

Version: 3.13.1909.0

Starting Monday (10/5/20) whenever a provisioning template (model1) is applied to a new site we get the following error:

A duplicate field name "mee9ebbf66b2406b9f94b5a339e27d1d" was found

I dug into the template (model1) and found that the column the error was referencing was a managed metadata site column. Something important to note about this column is that it's in our content type hub. After trying to apply the template (model1) a few more times, I would continue to get the duplicate field name error but for different fields, all of which were managed metadata columns in the content type hub.

So I extracted a model (model2) of the new site and compared it to the model file (model1) I was using and noticed that any column that threw the error had the same StaticName and Name in both files, but different ID's. What's weird is that other site columns coming from the content type hub in both models, continue to use the same ID, some of which are managed metadata fields.

Finally I extracted a model (model3) of the most recent new site which had the model (model1) applied successfully (9/30/20), and found that the ID's were different between these two model files (model1 v model3) as well. So sometime between 9/30/20 - 10/5/20 "something" decided to care that the ID's were different. What that something is, I have no idea : (

So I was wondering if anyone was experiencing the same issue? Or if someone knew of a solution?

Thanks!
Matt

Cannot generate a site template with cmdlet "get-pnpsitetemplate" when using pnp.powershell module

software + versions
VSCode version 1.51.1
Powershell Version 7.1
PnP.powershell module version 0.2.21

I try to generate a site template with the new cmdlet:
`$Global:TenantID = $appPrincipals.TenantID
$Global:ClientID = $appPrincipals.clientid
$Global:ClientSecret = $appPrincipals.clientSecret

built up the connection

$adminURl = "https://my365devops-admin.sharepoint.com"
$connection = Connect-PnPOnline -Url $adminURl -ReturnConnection -ClientId $Global:ClientID -ClientSecret $Global:ClientSecret
$web = Get-PnPWeb -Connection $connection
$web

#generate a site template
$Siteurl = "https://my365devops.sharepoint.com/sites/MSTeamsTemplatesiteforSPOSite"
Connect-PnPOnline -Url $Siteurl -ReturnConnection -ClientId $Global:ClientID -ClientSecret $Global:ClientSecret
Get-PnPSiteTemplate -Out ".\Template.xml"
I get the error:PS C:\GITREPO\DEV_PnP.Powershell> Get-PnPSiteTemplate -Out ".\Template.xml" Get-PnPSiteTemplate: {"error_description":"Invalid issuer or signature."} PS C:\GITREPO\DEV_PnP.Powershell>`

Can some one tell me what is wrong?????

Apply provisioning template doesn't include Site Pages document library custom field

Hi,

I have site, where I use Site Pages document library with Category column and I created provisioning template with the following command:
Get-PnPProvisioningTemplate -out met-news-template.xml -IncludeAllClientSidePages -IncludeSiteGroups -PersistBrandingFiles -Force
XML file generated and contains Category column, but if I want to apply template in other site with the following command:
Apply-PnPProvisioningTemplate -Path .\met-news-template.xml
the new Site Pages document library contains the site pages, but Category field is empty and If I create new site page then page properties is empty: "There are no custom properties available to add. Site owners can create properties by adding columns in the Pages library."
Under Library settings Category field is appear.

What could be the problem?
Please help!

Thanks,
Mykie

Taxonomy Fields Customization is not supported

Summary

In the case where we need to configure the advanced properties of Taxonomy Field, the command Get-PnpProvisioningTemplate is getting effectively all Customization from the ArrayOfProperty but the Apply-PnPProvisioningTemplate does not take in count this properties.

Current behavior

When the Taxonomy field is configured to display the full path to the term, the property in accordance with this parameter is correctly exported to the XML file:

<Customization>
  <ArrayOfProperty>
    ...
    <Property>
      <Name>IsPathRendered</Name>
      <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">true</Value>
    </Property>
  ...

When the Template is applied to the target site, this property is not take in count

Expected behavior

After applied the Template, all properties should be take in count and configured on the target site

[BUG] KeepPageCreationModificationInformation switch causing error on publishingpage transformation using ConvertTo-PnPClientSidePage

Thank you for reporting a bug. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. Thanks!

Problem Area

[X ] Page Transformation: Error during the use of page transformation from PnP PowerShell
[ ] Page Transformation: Error during the use of page transformation from .Net
[ ] Page Transformation: Page is not looking correct after transformation
[ ] Modernization Scanner: something went wrong...

Expected or Desired Behavior

Published news article hosted in classic site in SharePoint online converted to client side page in communication site on same tenant using the KeepPageCreationModificationInformation switch to maintain the original author, editor, created and modified information.

Observed Behavior

command failed with the error message:

_The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.   at Microsoft.SharePoint.Client.ListItem.GetFieldValue(String fieldName)
   at SharePointPnP.Modernization.Framework.Transform.BasePageTransformator.StoreSourcePageInformationToKeep(ListItem sourcePage)
   at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)_ 

When the KeepPageCreationModificationInformation switch is removed the page is converted successfully but the author and editor information is not migrated which is causing us a problem.

Steps to Reproduce

ConvertTo-PnPClientSidePage `
-Identity '************page.aspx' `
-PublishingPage `
-KeepPageCreationModificationInformation `
-PostAsNews `
-Overwrite `
-LogVerbose -LogType File -LogFolder c:\temp\Logs `
-TargetWebUrl https://***************.sharepoint.com/sites/news01 `
-PageLayoutMapping 'C:\Temp\custompagelayoutmapping.xml'

SharePointPnPPowerShellOnline version

3.26.2010.0

Modernization Summary Report

Date Duration Source Page Target Page Url Status
26/11/2020 13:03:14 00:00:01 A issue prevented successful transformation

Critical Errors during transformation

26/11/2020 13:03:16 -

The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. at Microsoft.SharePoint.Client.ListItem.GetFieldValue(String fieldName)
at SharePointPnP.Modernization.Framework.Transform.BasePageTransformator.StoreSourcePageInformationToKeep(ListItem sourcePage)
at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)

Individual Page details

Transformation Details:

  • Report date: 26/11/2020 13:03:14
  • Transform duration: 00:00:01
  • Transforming from site: https://***.sharepoint.com/news
  • Cross-Site transfer mode to site: https://***.com/sites/News01
  • A critical error occurred - transformation did not complete

Page Transformation Settings

Property Setting
Engine version 1.0.2010.0
Overwrite True
Target Page Name
Target Page Folder
Target Page Folder Overrides Default Folder False
Keep Page Specific Permissions True
Remove Empty Sections And Columns True
Handle Wiki Images And Videos True
Add Table List Image As Image Web Part True
Keep Page Creation Modification Information True
Publish Created Page True
Post As News True
Disable Page Comments False
Skip Url Rewrite False
Skip Default Url Rewrite False
Url Mapping File
Term Mapping File
Skip Term Store Mapping False
Skip User Mapping False
User Mapping File
L D A P Connection String
Skip Telemetry False

Transformation Operation Details

Date Operation Actions Performed
26/11/2020 13:03:15 Input Validation Validation checks complete
26/11/2020 13:03:15 SharePoint Connection Loading client context objects
26/11/2020 13:03:15 SharePoint Connection Loading target client context object

"Versioning must be enabled" error

We have a client with a site template that, as of late October, started throwing this error:

Versioning must be enabled and the number of major versions must be between 1 and 50000.

Any idea what might be causing this? This code had been working for a good 18 months.

Thanks!

Adding managed properties as part of provisioning template

Is there a way to provision a managed property as part of pnp provisioning templates? for example I am provisioning a site where I have a document library with managed metadata column. I want to have a highlighted web part that I added on a page as part of the provisioning template where it pulls all documents of specific term across different sites. I already deploy the term set, sites, with libraries and their fields & content types as part of my template, but am not sure how to solve the managed metadata part.

I know that the content has to be crawled first so I can create a managed property, but how do we handle this as part of the provisioning process?

pnp:Directory cannot apply multiple metadata values to a document

I'm trying to use pnp:Directory with a json file that is specified in MetadataMappingFile attribute. when a json file contains just one value for metadata field, it works properly.

{
    "testfolder\\demodoc.pdf":  {
        "VL_KnowledgeTopic":  "7743cc6a-5ddb-4ee3-add0-2748ca39d637"
    }
}

it works just fine.
The column settings are configured so that user can select multiple values for any document. However, when I try to use array of values in json,

{
    "testfolder\\demodoc.pdf":  {
        "VL_KnowledgeTopic":  ["7743cc6a-5ddb-4ee3-add0-2748ca39d637", "5aecf30d-df84-49d3-ad63-8a6d8e6fc917"]
    }
}

it throws an error:

Apply-PnPProvisioningTemplate : Unexpected character encountered while parsing value: [. Path '['testfolder\\demodoc.pdf'].VL_Knowled
geTopic', line 9, position 75.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Path C:\projects\contoso-virtual-libra ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], JsonReaderException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate

I also tried like this:

{
    "testfolder\\demodoc.pdf":  {
        "VL_KnowledgeTopic":  "7743cc6a-5ddb-4ee3-add0-2748ca39d637,5aecf30d-df84-49d3-ad63-8a6d8e6fc917"
    }
}

In this case it does not throw any error but neither sets it any value to this column.

Invoke-PnPSiteTemplate is applying the site footer in reverse order

Reporting an Issue or Missing Feature

If I export a site template using Get-PnPSiteTemplate the xml generated for the extended site footer is written left to right and top to bottom. If I then apply that xml template using Invoke-PnPSiteTemplate to another site, the footer is created in reverse order.

Example source footer:
Header 1 Header 2 Header 3
Link 1-1 Link 2-1 Link 3-1
Link 1-2 Link 2-2 Link 3-2

Get created on new site as:
Header 3 Header 2 Header 1
Link 3-2 Link 2-2 Link 1-2
Link 3-1 Link 2-1 Link 1-1

Expected behavior

When applying a footer template I am expecting it to be created exactly like the source site it was exported from.

Actual behavior

Footer is created in reverse order

Steps to reproduce behavior

  1. Connect-PnPOnline -Url https://[tenant name].sharepoint.com -Credentials(Get-Credential)
  2. Get-PnPSiteTemplate -Out template.xml
  3. Edit template.xml file and remove everything but the footer xml
  4. Connect-PnPOnline -Url https://[tenant name].sharepoint.com/sites/targetsite
  5. Invoke-PnPSiteTemplate -Path template.xml
  6. View target site and footer will be reversed.

What is the version of the Cmdlet module you are running?

PnP.Powershell 0.2.23
PS 7.0.3

[BUG] Get-PnPSiteTemplate time out

Hi.

I'm running version 0.2.18 of the new Pnp Powershell module (https://github.com/pnp/powershell), in an Azure Functions app. Consider this code extract:

Connect-PnPOnline -Url $templateSiteUrl -ClientSecret $env:SpoClientSecret -ClientId $env:SpoClientId
$basetemplate = Get-PnPSiteTemplate -IncludeAllClientSidePages -Handlers PageContents, Pages, ImageRenditions -OutputInstance -Schema LATEST -PersistBrandingFiles

This code results in a timeout error, which I believe is after Azure Function app 5 minutes of inactivity.

I'm wondering if the error is not on the server side (i.e Sharepoint Online), but maybe in the powershell library or maybe even my own code.

What's the recommended approach to debugging this sort of issue? Is it likely that it's an SPO issue which are yet to be resolved?

[BUG] Invoke-PnPSiteTemplate: Could not load file or assembly 'OfficeDevPnP.Core, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

Trying to run Invoke-PnPSiteTemplate, am getting the above error.

Expected behavior

Template to be applied to the connected site

Actual behavior

Returns the error:

Could not load file or assembly 'OfficeDevPnP.Core, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

Steps to reproduce behavior

Running Invoke-PnPSiteTemplate with a valid XML template

What is the version of the Cmdlet module you are running?

0.3.8

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Reapply template - reorder Content Types

We have a PnP Provisioning Template we are applying to multiple sites. We occasionally make IA changes and want to reapply the template to the existing sites.

One of the things we want to be able to do is reorder the Content Types in a list or library. It appears that in subsequent applications of the template, the order of the Content Types stays the same as when there were first added.

For example, I apply the template, which creates List A with CTs A3, A5, A1 - in that order. (That order made sense with only 3 CTs.) Later, we've added a bunch of new CTs to the template, and we reapply it to List A. Regardless what the order of the CTSs is in the prototype sites we use to export the new template, the CTs in List A stay in the order A3, A5, A1, with new CTs A2 and A4 added after them. In the new template, we have them in the order A1, A2, A3, A4, A5, but after application, we end up with A3, A5, A1, A2, A4.

Is this something which could be fixed in the engine?

Contribution Guidelines?

I'm updating my list of PnP repos and I noticed that I didn't have this repo in it.

You don't seem to have contribution guidelines, does that mean that you don't actively seek contributions from folks outside of this repo?

Using CredentialManager to authenticate

Will it remain possible to use credentials in the CredentialManager to connect to SharePoint online to use with the provision engine?
And what about when basic authentication is turned of for SharePoint online?

<pnp:Folders> enables folder creation

Looks like that if you use <pnp:Folders> to create folders for list instance, it will enable folders creation for the list even if there is EnableFolderCreation="false". I think that it is possible from the backend to create folders even if this setting is disabled.

AuthenticationManager: GetSharePointOnlineAuthenticatedContextTenant no longer supported?

I have some console applications that I use for analyse purposes that used the method GetSharePointOnlineAuthenticatedContextTenant in the AuthenticationManager class. This uses SharePoint Online Active Authentication Flow I think https://docs.microsoft.com/nl-nl/archive/blogs/sharepointdevelopersupport/sharepoint-online-active-authentication

This one is missing in the new framework. What should I use as an alternative?

IsAppOnly fails with FileNotFoundException

In a Azure Function based on dotNet 3.1 calling IsAppOnly gives me the Error
System.IO.FileNotFoundException for "System.IdentityModel.Tokens.Jwt, Version=6.7.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Strange thing is, that i see this Library with that Version in the dependencies of the azure Function but dll is not in /debug/bin folder while local debugging azure function.

I will try to further investigate in next days with separt AZFunc based on dotNet 2.1 - currently can reproduce this with 2 different projects with dotNet 3.1.

Optional values in TeamTemplate provisioning to create a Team from existing Group

Hi,
I tried to create a Team based on an exisiting Office 365 group using the TeamTemplate option. I used a parameter for the groupId (see the image)
image.
The problem is that since properties Displayname etc are required, I get a 400-error since you cannot supply any of those properties while creating from an Office 365 group.

It would be cool if you found a solution to have the properties as optional. In that scenario I could use my parameter and provision the Team.
Another solution would be to use "MailNickName" (as you have in other places), and then the user doesn't have to add "[email protected]": "https://graph.microsoft.com/v1.0/groups('{parameter:O365GrpId}')",. You instead do that from the backend.

So maybe if you are using "MailNickName", you don't have to use any of the other properties?

Just thinking out loud :)

[BUG]

Which PnP repository should you use to report the issue?

Please navigate to the appropriate repository by clicking on the link below and create your issue there. You can delete this section after you have navigated to the correct repository.

Environment

[X] Office 365 / SharePoint Online

Expected or Desired Behavior

Join a site to a hub and gain the hub navigation without impacting the associated site's permissions

Observed Behavior

A SharePoint group called "Hub Visitors" is added with Read access to the newly associated site. Sync hub permissions is turned off on the hub site.

Steps to Reproduce

I am running version 3.28.2012.0.

It seems Hub Visitors are only being added when the Team Site is not fully done provisioning. If you run the below code before the permission groups are renamed in "Advanced Site Permissions" to match the site title, you will get the Hub Visitors group. For example, I am making Excellent Team Site. The permission groups first just say Site Owners, Site Members, Site Visitors. If I run now, I get a Hub Visitors group. If I wait until those groups appear as Excellent Team Owners, Excellent Team Members, etc then Hub Visitors is not added.

<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.19.2003.0, Culture=neutral, PublicKeyToken=null" />
<pnp:Templates ID="CONTAINER-TEMPLATE-0598A2406709488081DEB6DB15098DC2">
<pnp:ProvisioningTemplate ID="TEMPLATE-0598A2406709488081DEB6DB15098DC2" Version="1" BaseSiteTemplate="GROUP#0" Scope="RootSite">
<pnp:WebSettings RequestAccessEmail="" WelcomePage="SitePages/Home.aspx" SiteLogo="" HubSiteUrl="https://eemancini.sharepoint.com/sites/testhub" CommentsOnSitePagesDisabled="false" QuickLaunchEnabled="true" MembersCanShare="true" SearchScope="DefaultScope" SearchBoxInNavBar="Inherit" />
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>

If I create a new team site and use the out of the box interface to join to a hub (Settings/Site Information) before the team site is done provisioning, I do not get a Hub Visitors group.

Future of On Prem SharePoint?

I'm not really sure if this is the right place for this, but here goes...

Now I understand that the CSOM libraries have effectively forked into Online and OnPrem versions and whether this is permanent, just until a hypothetical next version of SharePoint on-prem is released, or something else is unknown. However the on-prem CSOM remains a viable target for development and supporting existing development given the sizable installed base and investments.

I'd really like to understand the intended path forward here.

Could I humbly suggest that instead of a full shutdown, the project go into a "community only" mode so that bugfixes aren't siloed and workarounds ossified. It's already a separate repo on github, which can help keep the effort from interfering with the "new hotness" pnpframework.

[BUG] Add-PnPApp Fails with access denied when connected using a global tenant administrator account (on Windows)

Reporting an Issue

Add-PnPApp fails with access denied when connected using a tenant global administrator account.

  • Tested using sharepoint admin and tenant app catalog url (Connect-PnPOnline).
  • Tenant global administrator is also a site collection administrator of the app catalog site (built-in principals are also available Company Administrator and SharePoint Service Administrators)
  • Also tested using a new app catalog site (deleted the old one and recreated it)
  • MFA is not enabled on the admin account
  • Get-PnPApp is still working
  • It's also working with the latest version of "SharePointPnPPowerShellOnline" cmdlets

Expected behavior

App should be uploaded into the tenant site app catalog

Actual behavior

pnpissue

pnpissue1

Steps to reproduce behavior

Connect-PnPOnline -Url 'siteUrl' -Credentials 'credentials'
Add-PnPApp -Path 'appPath'

What is the version of the Cmdlet module you are running?

0.3.7 (Nightly) + Pswh 7.1.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

i found a bug

Hi, i create a communication site, added some text on it, then use pnp provision engine in c# to provision to another clean communication site. After that, all assets cloned successfully except the nav menus become like thiese {res:NavigationNode_0_1031_Title}. Any idea?

image

Azure Storage Connector missing, (un)intentional?

Hi team!

I've been kicking the tires of this package for the last week or so, since I am sick and tired of Azure Functions v1 ๐Ÿ˜ƒ. I'm very impressed thus far, as everything seems to behave as expected and no issues encountered!

Is there a reason why the AzureStorageConnector didn't make the transition from .NET to .NET Core? I assumed it was because it's still using the old, deprecated Microsoft.WindowsAzure.Storage packages.
If that's the case (and not some other reason), I can do a PR with an AzureStorageConnector that uses the new Azure.Storage.Blobs packages, since I needed it for my project.

Let me know what you think!

Using groupid token in provisioning causes Exception

Using a {groupid:...} token in site provisioning templates causes an exception when the current account does not have permissions to use the Graph API.

I will provide a pull request to fix this after I got internal approval to share it.

Error message when creating team using template

When I create a team using a provisioning template, and a logger is attached (Log4Net) The following error is reported:

ERROR Exception while archiving/unarchiving Team with ID ae...16d. Details: Exception while invoking endpoint https://graph.microsoft.com/beta/teams/ae...16d/unarchive..

Since we use the same logging for our system, we identify this as an alert, It doesn't seem to matter which value we supply for the Archived property, the error always seems to appear.

Question about release schedule

In the graphic that describes the release schedule for GA if says framework depends on the Core SDK GA release. Please clarify if that means that the schedule depends on it or if that means the package is a dependency of framework.

Support Tokens in Page Mapping

Category

[ ] Bug
[X] Enhancement

Problem Area

[ ] Page Transformation: Error during the setup/use of the Page Transformation UI solution (did you check our troubleshooting guide?)
[X] Page Transformation: Error during the use of page transformation from PnP PowerShell
[ ] Page Transformation: Error during the use of page transformation from .Net
[ ] Page Transformation: Page is not looking correct after transformation
[ ] Modernization Scanner: something went wrong...

Expected or Desired Behavior

Consider adding tokenization to the mapping file to populate properties like Header type in PowerShell before passing the mapping file into ConvertTo-PnPClientSidePage.

A mechanism much like the properties you can pass to PnP Provisioning that replace values prior to processing the file.

This would reduce the number of duplicate mapping files for variants of a transformation based on criteria, see ref pnp/modernization#459 for details of a recent scenario example.

Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown

i tried my provisioning template in one tenant, it worked perfectly, i tried to use it in another tenant, it gave me the error i mentioned. i turned on logging using Set-PnPTraceLog -On to see where it errors and it errors when it tries to check the spfx packages in the app catalog.

I checked that I am a site collection admin in the new tenant's app catalog and i am. I have Global Admin, Power platform admin and SharePoint admin on the new tenant, and site collection admin on the app catalog.

Authentication with AAD App and Certificate fails after 90 seconds

Hi,
I'm seeing a strange behavior when using the Authentication Manager's GetAppContext() method in Azure Functions V3.
The code for getting the ClientContext is as follows:

string keyVaultUrl = Environment.GetEnvironmentVariable(Constants.PARAM_KEYVAULT_URL, EnvironmentVariableTarget.Process);
SecretClient keyVault = new SecretClient(new Uri(keyVaultUrl), new DefaultAzureCredential());
string appId = keyVault.GetSecret(Constants.KVKEY_TEAMS_CLIENTID).Value.Value;

string certificateStr = keyVault.GetSecret(Environment.GetEnvironmentVariable(Constants.PARAM_TEAMSCERTIFICATE_NAME)).Value.Value;
var certificate = new X509Certificate2(Convert.FromBase64String(certificateStr),
                                                   (string)null, X509KeyStorageFlags.Exportable |
                                                   X509KeyStorageFlags.MachineKeySet |
                                                   X509KeyStorageFlags.PersistKeySet);

if (!certificate.HasPrivateKey)
      log.LogWarning("Certificate incomplete!!!");
AuthenticationManager authMgr = new AuthenticationManager(appId, certificate, tenantId);
ClientContext ctx = authMgr.GetContext(hostUrl);

This is used inside an activity function of a durable task orchestration. The function and the above code executes perfectly fine about 20-30 times. Then, after 90 seconds have past, the next executions throw the exception 'Keyset does not exist' in the last line (authMgr.GetContext()).
The stacktrace I get from Application Insights is this:

[{"assembly":"System.Security.Cryptography.Csp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"Internal.NativeCrypto.CapiHelper.CreateProvHandle","level":0,"line":0},{"assembly":"System.Security.Cryptography.Csp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"System.Security.Cryptography.RSACryptoServiceProvider.get_SafeProvHandle","level":1,"line":0},{"assembly":"System.Security.Cryptography.Csp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"System.Security.Cryptography.RSACryptoServiceProvider.get_SafeKeyHandle","level":2,"line":0},{"assembly":"System.Security.Cryptography.Csp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"System.Security.Cryptography.RSACryptoServiceProvider..ctor","level":3,"line":0},{"assembly":"System.Security.Cryptography.Csp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"System.Security.Cryptography.RSACryptoServiceProvider..ctor","level":4,"line":0},{"assembly":"System.Security.Cryptography.X509Certificates, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"Internal.Cryptography.Pal.CertificatePal+<>c.<GetRSAPrivateKey>b__66_0","level":5,"line":0},{"assembly":"System.Security.Cryptography.X509Certificates, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"Internal.Cryptography.Pal.CertificatePal.GetPrivateKey","level":6,"line":0},{"assembly":"System.Security.Cryptography.X509Certificates, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"Internal.Cryptography.Pal.CertificatePal.GetRSAPrivateKey","level":7,"line":0},{"assembly":"System.Security.Cryptography.X509Certificates, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"Internal.Cryptography.Pal.CertificateExtensionsCommon.GetPrivateKey","level":8,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Platforms.netcore.NetCoreCryptographyManager.SignWithCertificate","level":9,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Internal.JsonWebToken.Sign","level":10,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Internal.Requests.ClientCredentialHelper.CreateClientCredentialBodyParameters","level":11,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.OAuth2.TokenClient.AddBodyParamsAndHeaders","level":12,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.OAuth2.TokenClient+<SendTokenRequestAsync>d__5.MoveNext","level":13,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":14,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":15,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":16,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Internal.Requests.RequestBase+<SendTokenRequestAsync>d__20.MoveNext","level":17,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":18,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":19,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":20,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest+<FetchNewAccessTokenAsync>d__3.MoveNext","level":21,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":22,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":23,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":24,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest+<ExecuteAsync>d__2.MoveNext","level":25,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":26,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":27,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":28,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.Internal.Requests.RequestBase+<RunAsync>d__13.MoveNext","level":29,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":30,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":31,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":32,"line":0},{"assembly":"Microsoft.Identity.Client, Version=4.24.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae","method":"Microsoft.Identity.Client.ApiConfig.Executors.ConfidentialClientExecutor+<ExecuteAsync>d__3.MoveNext","level":33,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":34,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":35,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":36,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter`1.GetResult","level":37,"line":0},{"assembly":"PnP.Framework, Version=0.1.77.0, Culture=neutral, PublicKeyToken=null","method":"PnP.Framework.AuthenticationManager+<GetContextAsync>d__28.MoveNext","level":38,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":39,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":40,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":41,"line":0},{"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter`1.GetResult","level":42,"line":0},{"assembly":"PnP.Framework, Version=0.1.77.0, Culture=neutral, PublicKeyToken=null","method":"PnP.Framework.AuthenticationManager.GetContext","level":43,"line":0}]

Sorry for the lengthy json. You'll get a convenient view after pasting that into https://jsonformatter.org.
As this always occurs after 90 seconds have past, it seems to be some timeout/limits issue. It will refuse to authenticate for several minutes and then it starts working again (for 90 seconds). I absolutely have no clue what could cause this and if there's something I could do to avoid that. I also have found no way to use the client secret of the App for authentication. Though that would only be the last resort if certificates are not a reliable option.
Hoping that someone in this forum could help me with that problem.
Thanks in advance.

Environment:

  • Azure Function using .NET Core 3.1 on Windows
  • PnP.Framework v 0.1.77.0
  • Code is used inside an activity function of a durable task orchestration

On-Behalf-Of authorization in AuthenticationManager, flexible Authentication Authority

I am trying to implement Web API using the library via AzureAD, Enterprise application as Authentication mechanism, Pnp.Framework as backend and AadHttpClient javascript as front-end. This has led me to an authentication issue:

The token passed from the client-side to the back-end is not recognized for use in AuthenticationManager.GetAccessTokenContext(siteUrl, token). It returns 401 Unauthorized. As a workaround I wanted to use OAuth OBO mechanism, but the library lacks client context type of ClientContextType.AzureADOnBehalfOf (or similar to) which would use the token retrieved from the client in a call to acquire a new token for SPO. This could be done in a call confidentialClientApplication.AcquireTokenOnBehalfOf(scopes, new UserAssertion(token)). Ofcourse, the library also lacks a constructor which would create AuthenticationManager with clientid and secret - ConfidentialClientApplicationBUilder.Create(clientId).WithClientSecret(clientSecret);

A final note, at the moment Enterprise Applications can be registered as single-tenant or multi-tenant, but the Pnp.Framework strictly requires multi-tenant applications, because it has hardcoded authority ending in /organizations, which is not allowed to be used by single-tenant applications after year 2018. On the other hand, it is easy enough to just make the application multi-tenant.

I am not sure if I am doing something wrong (e.g. incorrectly using jwt token of AadHttpClient) or if the library (sh-)could be extended to allow more flexible approach, so any feedback would be appreciated.

Deploying Teams App no error

Hi,

I tried to deploy an app to Teams application catalog by using PnPTenantTemplate and Provisioning Schema 2020/02. The xml template is below:

<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema" Author="John Smith" Generator="Human being" Version="1.0" Description="A sample Provisioning document" DisplayName="Sample Provisioning" ImagePreviewUrl="https://sharepointpnp.com/ImagePreview.png"> <pnp:Teams> <pnp:Apps> <pnp:App AppId="27d2bec7-2237-486f-87e8-efez7a6c697b" PackageUrl=".\myApp.zip" /> </pnp:Apps> </pnp:Teams> </pnp:Provisioning>

There is no error message being thrown but the application is not in the app catalog yet. Even when I tried to change the PackageUrl into something else that doesn't exist, it will still proceed and did not throw any error message.

I already tried PackageUrl=
"myApp.zip"
"./myApp.zip"

When I add the .zip file directly in the teams admin centre/upload custom app, it works fine.

Is there any error handling for deploying teams? How can I deploy the app to the app catalog successfully using the schema?

Incorporating this into SPMT or equivalent experience

Category

[ ] Bug
[X] Enhancement

Expected or Desired Behavior

Include the modernization tooling as part of SPMT or Standalone tooling. This would provide a UI like experience to converting the pages - for those that are less familiar with PowerShell or ASP.NET.

I might do some investigating over the demand for this.

Where Can I find minimal Documentation

Where Can I find minimal Documentation is it based on something else to get started?
I want to use this framework going forward but don't know even how to get a site list items files etc..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.