Skip to content

This extension includes a group of tasks that leverages SharePoint and O365 functionalities for build and release.

License

Notifications You must be signed in to change notification settings

RazorSPoint/azuredevops-pnp-tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SharePoint Build and Release Tasks

Build [Build Status
Internal release current internal release status
Public Release current public release status

This extension includes a group of tasks that leverages SharePoint and O365 functionalities for build and release.

Note: This project is used with GitHub and Azure DevOps projects features. Where GitHub is used for code and issues, but the complete build pipeline is hosted on Azure DevOps in the background.

Content:

Task Deploy PnP SharePoint Artifacts

Deploys SharePoint artifacts (e.g. lists, fields, content type...) with the publish PnP PowerShell, which uses the PnP Provisioning Engine. This task works mainly in the same way as described in the documentation of the PnP PowerShell cmdlet Apply-PnPProvisioningTemplate. This PowerShell task allows you to use PnP PowerShell, which will be loaded prior executing any script. The newest releast modules are downloaded from the official PSGallery feed, if not present on the agent.

Mandatory Fields

First the SharePoint version has to be chosen.

SharePoint Choice

You need to create a service connection to SharePoint. This service connection comes with the extension.

Service Connection to SharePoint

This connection is currently not working with MFA (multi factor authentication) enabled tenants. You need to either be inside the coporate network (or VPN connection) that allows authentication without MFA or you use a service account, that does not have MFA enabled.

After that use the created connection in your task

Service Connection to SharePoint

Next, you choose if you want to use a file from your build or if you want to use inline xml. A specific xml schema is expected which is parsed by the PnP provisioning engine.

Type of Input

You can include the following XML, which changes the title of the connected web

<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2017/05/ProvisioningSchema">
  <pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.18.1709.0, Culture=neutral, PublicKeyToken=3751622786b357c2" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-CE97DA40966E445087F3E67032B06CC6">
    <pnp:ProvisioningTemplate ID="TEMPLATE-CE97DA40966E445087F3E67032B06CC6" Version="1" BaseSiteTemplate="STS#0" Scope="Web">
      <pnp:WebSettings NoCrawl="false" Title="My Web Title" WelcomePage="" AlternateCSS="" MasterPageUrl="{masterpagecatalog}/seattle.master" CustomMasterPageUrl="{masterpagecatalog}/seattle.master" />
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>

Optional Fields

Handler To Be Used

Then you can optionally give a comma separated list of Handlers (e.g. Lists,Fields). Leave empty if all Handlers should be used. This Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Check for available Handlers.

Parameters To Be Added

The field "Parameters To Be Added" allows you to specify parameters that can be referred to in the template by means of the {parameter:} token. use only one parameter-value pair per line.

Example:

ListTitle=Projects
parameter2=a second value

Parameters

See examples on how it works internally.

Advanced Parameters

ClearNavigation

Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template.

Ignore Duplicate Data Row Errors

Ignore duplicate data row errors when the data row in the template already exists.

Overwrite System Property Bag Values

Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.)

Provision Content Types To Sub Webs

If set content types will be provisioned if the target web is a subweb.

Task PnP PowerShell

This task is inspired by the official PowerShell task for Azure DevOps. The source code is located in GitHub. This PowerShell task allows you to use PnP PowerShell, which will be loaded prior executing any script. The newest release modules are downloaded from the official PSGallery feed, if not present on the agent.

Mandatory Fields

First the SharePoint version has to be chosen.

SharePoint Choice

You need to create a service connection to SharePoint. This service connection comes with the extension.

Service Connection to SharePoint

This connection is currently not working with MFA (multi factor authentication) enabled tenants. You need to either be inside the coporate network (or VPN connection) that allows authentication without MFA or you use a service account, that does not have MFA enabled.

After that use the created connection in your task

Service Connection to SharePoint

Next, you choose if you want to use a file from your build or if you want to use inline PowerShell. The correct PnP PowerShell library is downloaded and imported automatically.

Pnp Power Shell01

When the type is chosen, the file or inline PowerShell must be a valid PowerShell.

$web = Get-PnPWeb

Write-Host "Connected to the url $($web.Url)"

You don't need to provide credentials in the script or connect to the SharePoint site. This is will be done by the task.

Optional Fields

ErrorActionPreference

Prepends the line $ErrorActionPreference='VALUE' at the top of your script. Possible values are 'STOP', 'CONTINUE' or 'SILENTLYCONTINUE'.

Advanced Parameters

Fail on Standard Error

If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream. Otherwise the task will rely on the exit code to determine failure.

Working Directory

Working directory where the script is run.


About

This extension includes a group of tasks that leverages SharePoint and O365 functionalities for build and release.

Resources

License

Stars

Watchers

Forks

Packages

No packages published