id
stringlengths
14
16
text
stringlengths
2
3.14k
source
stringlengths
45
175
8e8e5a5c906f-11
Subsite expanding Often you want the timer job code to be executed against the root site of the site collection and against all the subsites of that site collection. To do this, set the ExpandSubSites property to true . This causes the timer job to expand the subsites as part of the site resolving step. Override...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-12
//Delete the first one from the list...simple change. A real life case could be reading the site scope //from a SQL (Azure) DB to prevent the whole site resolving. addedSites.RemoveAt(0); //Return the updated list of resolved sites...this list will be processed by the timer job return addedSites; } ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-13
void SimpleJob_TimerJobRun(object sender, TimerJobRunEventArgs e) { // your timer job logic goes here } An alternative approach is using an inline delegate as shown here: public SimpleJob() : base("SimpleJob") { // Inline delegate TimerJobRun += delegate(object sender, TimerJobRunEventArgs e) { ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-14
SiteClientContext property: Gets or sets the ClientContext object for the root site of the site collection. This property provides access to the root site should the timer job require access to it. For example, the timer job can add a page layout to the master page gallery by using the SiteClientContext property. ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-15
PreviousRunVersion property: Gets or sets the timer job version of the previous run. Next to these standard properties, you also have the option to specify your own properties by adding keyword–value pairs to the Properties collection of the TimerJobRunEventArgs object. To make this easier, there are three metho...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-16
// Get the number of admins var admins = e.WebClientContext.Web.GetAdministrators(); Log.Info("SiteGovernanceJob", "ThreadID = {2} | Site {0} has {1} administrators.", e.Url, admins.Count, Thread.CurrentThread.ManagedThreadId); // grab reference to list library = "SiteAssets"; ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-17
e.CurrentRunSuccessful = true; e.DeleteProperty("LastError"); } catch(Exception ex) { e.CurrentRunSuccessful = false; e.SetProperty("LastError", ex.Message); } } The state is stored as a single JSON serialized property, which means it can be used by other customizations as wel...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-18
Note It is important to use ExecuteQueryRetry in your timer job implementation code. Concurrency issues - process all subsites of a site collection in the same thread Timer jobs may have concurrency issues when using multiple threads to process subsites. Take this example: Thread A processes the first set o...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-19
void SiteCollectionScopedJob_TimerJobRun(object sender, TimerJobRunEventArgs e) { // Get all the subsites in the site we're processing IEnumerable<string> expandedSites = GetAllSubSites(e.SiteClientContext.Site);
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-20
// Manually iterate over the content foreach (string site in expandedSites) { // Clone the existing ClientContext for the sub web using (ClientContext ccWeb = e.SiteClientContext.Clone(site)) { // Here's the timer job logic, but now a single site colle...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-21
ConsoleTraceListener writes logs to the console. The method described in Cloud Diagnostics - Take Control of Logging and Tracing in Windows Azure . This method uses Microsoft.WindowsAzure.Diagnostics. DiagnosticMonitorTraceListener . Additional Azure resources can be found here: Enable diagnostics logging for we...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
8e8e5a5c906f-22
// Get the number of admins var admins = e.WebClientContext.Web.GetAdministrators(); Log.Info("SiteGovernanceJob", "ThreadID = {2} | Site {0} has {1} administrators.", e.Url, admins.Count, Thread.CurrentThread.ManagedThreadId); // Additional timer job logic... e.CurrentRunSuccessful =...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/timerjob-framework
4e74ffae853a-0
Timer jobs are background tasks that operate on a timed or recurrent basis to manage your SharePoint sites. Article Description PnP timer job framework Describes set of classes designed to ease the creation of background processes that operate against SharePoint sites. Create remote timer ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-remote-timer-job-framework
3b53cf420c2a-0
To support the new add-in model, the Office 365 Developer Patterns and Practices (PnP) program introduced a provisioning framework that allows users to: Create custom site templates by simply pointing at a site model. Persist the model as a provisioning template. Apply the custom template to existing site colle...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-1
Open Visual Studio, and then choose File > New > Project . In the New Project Wizard, choose Visual C# , and then choose Console Application . Name the project Program , and then choose OK . (You can name the project anything you like, but be mindful that this walkthrough will reference the project nam...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-2
using Microsoft.SharePoint.Client; using OfficeDevPnP.Core.Framework.Provisioning.Connectors; using OfficeDevPnP.Core.Framework.Provisioning.Model; using OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers; using OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml; using System; using System.Net; using System.Se...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-3
// Collect information string templateWebUrl = GetInput("Enter the URL of the template site: ", false, defaultForeground); string targetWebUrl = GetInput("Enter the URL of the target site: ", false, defaultForeground); string userName = GetInput("Enter your user name:", false, defaultForeground); string pwdS = ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-4
string value = ""; for (ConsoleKeyInfo keyInfo = Console.ReadKey(true); keyInfo.Key != ConsoleKey.Enter; keyInfo = Console.ReadKey(true)) { if (keyInfo.Key == ConsoleKey.Backspace) { if (value.Length > 0) { value = value.Remove(value.Length - 1); Console.SetCursorPosition(Consol...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-5
// Create FileSystemConnector to store a temporary copy of the template ptci.FileConnector = new FileSystemConnector(@"c:\temp\pnpprovisioningdemo", ""); ptci.PersistComposedLookFiles = true; ptci.ProgressDelegate = delegate(String message, Int32 progress, Int32 total) { // Only to output progre...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-6
return template; } } In the previous code snippet, we also defined a ProvisioningTemplateCreationInformation variable, pcti . The variable gives us the option to store information about artifacts that we can save along with the template. Create a file system connector object so that we can store a temporary...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-7
ctx.RequestTimeout = Timeout.Infinite; Capture site artifacts that were stored using the ProvisioningTemplateCreationInformation method by using the companion method, ProvisioningTemplateApplyingInformation . ProvisioningTemplateApplyingInformation ptai = new ProvisioningTemplateApplyingInformation(); ptai.Pr...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-8
{ // ctx.Credentials = new NetworkCredentials(userName, pwd); ctx.Credentials = new SharePointOnlineCredentials(userName, pwd); ctx.RequestTimeout = Timeout.Infinite;
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
3b53cf420c2a-9
Web web = ctx.Web; ProvisioningTemplateApplyingInformation ptai = new ProvisioningTemplateApplyingInformation(); ptai.ProgressDelegate = delegate (String message, Int32 progress, Int32 total) { Console.WriteLine("{0:00}/{1:00} - {2}", progress, total, message); }; // Associate file connector...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
83fd33f312a1-0
As you learned in PnP provisioning framework and elsewhere, the format for provisioning templates has been decoupled from the persistence format so that you can use any format you prefer. Nevertheless, because using the XML provisioning schema for persisting templates is such a common scenario, we're providing some a...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-schema
83fd33f312a1-1
<pnp:SupportedUILanguages /> <pnp:AuditSettings /> <pnp:PropertyBagEntries /> <pnp:Security /> <pnp:SiteFields /> <pnp:ContentTypes /> <pnp:Lists /> <pnp:Features /> <pnp:CustomActions /> <pnp:Files /> <pnp:Pages /> <pnp:TermGroups /> <pnp:ComposedLook /> <pnp:Workflows /> <pnp...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-schema
8dc6f09e6061-0
If you have a template which contains file references (through the <pnp:Files /> element) you will have to distribute both the xml file and the files that are referred to. While this of course works, it is very easy to miss files when copying them to another location. Note The PnP Provisioning Framework & ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
8dc6f09e6061-1
This is an example of the contents of that file: <PnPFilesMap xmlns="clr-namespace:OfficeDevPnP.Core.Framework.Provisioning.Connectors.OpenXML.Model;assembly=OfficeDevPnP.Core" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <PnPFilesMap.Map> <x:String x:Key="19cd09af-97a4-4015-ab9e-22451180702a.xml">th...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
8dc6f09e6061-2
<x:String x:Key="35667dfc-1a0c-4322-8980-43c58dd6ea70.png">assets/SitePages/2019-sales-leadership-award/sales-leadership-award.png</x:String> <x:String x:Key="5c886067-3fd3-48bc-974e-75e7fc3aece0.jpeg">assets/SitePages/Contoso-called-on-drone-pilots-to/AdobeStock_145027729.jpeg</x:String> <x:String x:Key="eeebf...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
8dc6f09e6061-3
<x:String x:Key="e79b754e-c9f3-44a0-ae57-00119f326cf7.jpeg">assets/SitePages/Our-commitment-to-sustainability/AdobeStock_83900723.jpeg</x:String> <x:String x:Key="1fca3e50-1d69-4bd1-87db-d3363803b6c8.jpg">assets/SitePages/Patti-announces-flagship-store-opening/contoso-storefront.jpg</x:String> <x:String x:Key="...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
8dc6f09e6061-4
<x:String x:Key="a6e4fc79-27c5-4f66-b540-fcb4ce1783c9.jpg">assets/SitePages/ThePerspective/23363-showcase.jpg</x:String> <x:String x:Key="4bde9cf8-20c0-41a2-a28a-32d502d1e030.jpg">assets/SitePages/ThePerspective/27137-consumer-showcase-thumb-1.jpg</x:String> <x:String x:Key="8561942b-8c11-4b30-afca-0bfd3a8a4c45...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
8dc6f09e6061-5
<x:String x:Key="abcc211e-18fc-4864-9c06-724b47164102.jpg">assets/SitePages/ThePerspective/nasa-_SFJhRPzJHs-unsplash.jpg</x:String> <x:String x:Key="ca166bc3-c2ec-44bf-8933-2a688d8702d2.png">assets/SitePages/Why-simplicity-matters/poster-patti-quote.png</x:String> </PnPFilesMap.Map> </PnPFilesMap> You'll see t...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
8dc6f09e6061-6
Create a configuration file and make sure to at least set the persistAssetFiles property to true , optionally specifying to extract libraries like SiteAssets, Shared Documents, WebSettings (for the logo etc.). Create a new folder on your file system and navigate to that folder with PowerShell. Extract a templa...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/the-pnp-office-open-xml-file-format
4782d4ba59fd-0
Think of Tenant Templates as an extension on top of PnP Provisioning or Site Templates. Instead of just provisioning artifacts to a site, you can now create sites, create teams, provision Azure AD entries, provision taxonomy etc. Note The PnP Provisioning Framework & PnP Provisioning Engine are open-source so...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-tenant-templates
4782d4ba59fd-1
</pnp:SiteCollections> </pnp:Sequence> In the snippet above you see that we're creating a communication site when applying the template. It is important to have xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attribute in the <pnp:SiteCollection> element, as it allows the schema to figure out which prope...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-tenant-templates
4782d4ba59fd-2
<pnp:Security> <pnp:Owners> <pnp:User UserPrincipalName="user@domain.com" /> </pnp:Owners> <pnp:Members> <pnp:User UserPrincipalName="user@domain.com" /> </pnp:Members> </pnp:Security> <pnp:DiscoverySettings ShowInTeamsSearchAndSuggestions="false" /> ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-tenant-templates
4782d4ba59fd-3
Provisioning Tenant Template containing a Team with PnP PowerShell As the only way to create a team programmatically is by using the Microsoft Graph, we require an access token for the Graph when you use PnP PowerShell to provision a template with a Teams element in it. PnP PowerShell can automatically acquire such a...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-tenant-templates
4782d4ba59fd-4
See also Microsoft 365 Patterns and Practices SharePoint Developer Group at Microsoft Tech Community PnP remote provisioning
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-tenant-templates
100d6c58ee04-0
The PnP provisioning engine is the heart of the provisioning framework, and at its foundation is the OfficeDevPnP.Core library. The provisioning engine is part of the Core library and it leverages the Core library extensions in the implementation of provisioning tasks. Note The PnP Provisioning Framework & PnP...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
100d6c58ee04-1
You can use one of two approaches for extracting your site design as a provisioning template. Use Windows PowerShell scripts (PnP.PowerShell), or use CSOM/REST code that implements extension methods provided by the Core library (OfficeDevPnP.Core). Using Windows PowerShell scripting to extract a provisioning template...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
100d6c58ee04-2
Note Instructions for locating and installing the Core library NuGet package, and a walkthrough for a remote provisioning sample console application, are available in Provisioning console application sample . Note that the Core library comes in two versions: one targets SharePoint Online and one targets SharePoint o...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
100d6c58ee04-3
Either point to a model site or compose an XML document that validates against the PnP provisioning schema, or write .NET code and construct the hierarchy of objects. You can even mix these approaches. You also can design the provisioning template by using a model site, and then save it into an XML file and do some in-...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
100d6c58ee04-4
// Create FileSystemConnector, so that we can store composed files somewhere temporarily ptci.FileConnector = new FileSystemConnector(@"c:\temp\pnpprovisioningdemo", ""); ptci.PersistComposedLookFiles = true; ptci.ProgressDelegate = delegate (String message, Int32 progress, Int32 total) { // Use this to simply output...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
100d6c58ee04-5
Console.WriteLine("End: {0:hh.mm.ss}", DateTime.Now); } PnP Core library The Core library (OfficeDevPnP.Core) is a CSOM/REST object model that supports the PnP provisioning framework and enables the PnP provisioning engine. It consists of several namespaces, including a set of extension methods . These methods ex...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
100d6c58ee04-6
OfficeDevPnP.Core.Framework.Provisioning.Model Template data model objects. Templates are either extracted or de-serialized to actual C# code. This namespace contains classes for this structure. OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers Handlers for different SharePoint elements supporting both ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-engine-and-the-core-library
b6724af20e8c-0
The PnP provisioning framework provides a code-centric and template-based platform for provisioning your site collections. The new provisioning engine allows you to persist and reuse provisioning models in Office 365 and SharePoint Online as well as on-premises site collections. Note The PnP Provisioning Framewo...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-framework
b6724af20e8c-1
Serialize and reuse templates . You can serialize and then reuse your provisioning templates. Persist templates in serialized format . You are able to persist your provisioning templates in whichever serialization format works best for you; for example, XML or JSON. Provision new site collections . You can easi...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-framework
b6724af20e8c-2
Creating and optionally persisting your provisioning template in a serialized format that you choose. Applying the provisioning template to a new or existing site collection that was created by using an out-of-the-box site template. 1. Design and create your site customization Step one is to create the site...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-framework
b6724af20e8c-3
To see a sample of remote provisioning in action, including serialization of the provisioning template to XML, see Provisioning console application sample . See also PnP remote provisioning
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-framework
4214915faaa2-0
Sometimes you do not want to extract all artifacts from a site, or only even a specific list. For that the PnP Provisioning Engine uses a JSON formatted configuration file which gives you detailed control over the process. Extraction Configuration There is a JSON schema available at https://aka.ms/sppnp-extract-co...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configuring-the-pnp-provisioning-engine
4214915faaa2-1
"includeAllClientSidePages": true } } Using the configuration above we limit the extraction of lists to only include the list called "My Test List". We're telling the engine that we do want to export list items to the template (they will show up as DataRow elements), and we tell the engine also to include any atta...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configuring-the-pnp-provisioning-engine
f8fb073576e1-0
This article introduces the PnP provisioning engine, which was originally released in April 2015 within the OfficeDev PnP project, and which is updated on a monthly basis in alignment with the release schedule of the Office Dev PnP Core Library. Note The PnP Provisioning Framework & PnP Provisioning Engine ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-1
Using the new PnP provisioning engine, you can model a site by configuring the design of site columns, content types, list definitions and instances, pages, and much more, via your web browser. When you are done with the design, you can export what you have done into a provisioning template format (XML, JSON, or a cont...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-2
To export that site as a provisioning template, you can either use PowerShell or CSOM code, with some extension methods, which are provided by the OfficeDev PnP Core Library. Using PowerShell cmdlets Note This article focuses on using PnP PowerShell to work with the Provisioning Engine. If you prefer using C#, ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-3
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.14.1910.1, Culture=neutral, PublicKeyToken=null" /> <pnp:Templates ID="CONTAINER-TEMPLATE-8F4D883BE25B442FB9F889C351D3EA0B"> <pnp:ProvisioningTemplate ID="TEMPLATE-8F4D883BE25B442FB9F889C351D3EA0B" Version="1" BaseSiteTemplate="SITEPAGEPUBLISHING#0" Scope="...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-4
</pnp:Navigation> <pnp:Lists> <pnp:ListInstance Title="Events" Description="" DocumentTemplate="" TemplateType="106" Url="Lists/Events" MinorVersionLimit="0" MaxVersionLimit="0" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-ec85-4903-972d-ebe475780106" ContentTypesEnabled="true" EnableFolderCreat...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-5
<pnp:DataValue FieldName="fAllDayEvent">false</pnp:DataValue> <pnp:DataValue FieldName="EventDate">2020-01-02 10:00:00</pnp:DataValue> <pnp:DataValue FieldName="EndDate">2020-01-02 12:00:00</pnp:DataValue> </pnp:DataRow> </pnp:DataRows> </pnp:Lists> <pnp:ClientSideP...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-6
<pnp:Controls> <pnp:CanvasControl WebPartType="News" JsonControlData="{&quot;id&quot;: &quot;8c88f208-6c77-4bdb-86a0-0c47b4316588&quot;, &quot;instanceId&quot;: &quot;1ac6db3e-eb95-4d5d-a991-28ee34772313&quot;, ..." ControlId="8c88f208-6c77-4bdb-86a0-0c47b4316588" Order="1" Column="1" /> ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-7
<pnp:CanvasControl WebPartType="Custom" JsonControlData="{&quot;id&quot;: &quot;868ac3c3-cad7-4bd6-9a1c-14dc5cc8e823&quot;, &quot;instanceId&quot;: &quot;c1524d29-ab2a-44a3-809e-c01c3762c4ee&quot;, &quot;title&quot;: &quot;Weather&quot;, &quot;description&quot;:..." ControlId="868ac3c3-cad7-4bd6-9a1c-14dc5cc8e823" Orde...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-8
<pnp:Controls> <pnp:CanvasControl WebPartType="Image" JsonControlData="{&quot;id&quot;: &quot;d1d91016-032f-456d-98a4-721247c305e8&quot;, &quot;instanceId&quot;: &quot;984b089c-ca62-4f92-89c0-1ce0e1cb6c03&quot;, &quot;title&quot;: &quot;Image&quot;, &quot;description&quot;: &quot;Image&quot;, &quot;data...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-9
</pnp:CanvasControlProperties> </pnp:CanvasControl> <pnp:CanvasControl WebPartType="Button" JsonControlData="{&quot;id&quot;: &quot;0f087d7f-520e-42b7-89c0-496aaf979d58&quot;, &quot;instanceId&quot;: &quot;deb39e2b-11a0-4141-8ac1-1078fe7cc392&quot;, &quot;title&quot;: &quot;..." ControlI...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-10
</pnp:ProvisioningTemplate> </pnp:Templates> </pnp:Provisioning> As you can see, the XML elements are fairly self-explanatory. The XML schema used in the example references the 201909 version of the PnP provisioning schema, which has been defined together with the SharePoint PnP Community, and which can be found o...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-11
The –Path argument refers to the source template file, which the cmdlet automatically applies to the currently connected site (implied by the Connect-PnPOnline cmdlet). Note The rule of thumb is that when you apply a site template the site you target needs to be created and working. If you want to create the ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-12
<pnp:Templates ID="SITE-TEMPLATES"> <pnp:ProvisioningTemplate ID="MAIN-TEMPLATE" Version="1" BaseSiteTemplate="SITEPAGEPUBLISHING#0" Scope="RootSite"> <pnp:Header Layout="Compact" MenuStyle="MegaMenu" BackgroundEmphasis="Strong" /> As you can see, the sequence is defined at the same level as the <pnp:Temp...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
f8fb073576e1-13
Requirements and wrap-up To play with the PnP provisioning engine on-premises, you need to have at least the SharePoint 2013 March 2015 Cumulative Update installed, because the engine leverages some capabilities of the client-side object model which are not available in previous versions of the product. If you targ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
c72bb7190f0d-0
The current recommendation when it comes to provisioning artifacts like sites, lists, content types, pages is to use something called "remote provisioning". In a nutshell, remote provisioning means that you utilize one of the available APIs (SharePoint REST, the SharePoint Client Side Object Model or the Microsoft Grap...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-remote-provisioning
c72bb7190f0d-1
Learn how to configure the engine by using a JSON configuration file. The PnP Office Open XML File Format Learn about the .PnP file format, which is an Office Open XML file, and how it is built up. PnP provisioning framework Get a high-level overview of remote provisioning features available for your Of...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-remote-provisioning
d6713bc831a5-0
This page explains some steps developers should consider taking on their projects that leverage the Office 365 APIs prior to distributing them to other developers, their customers, or to source control systems such as Team Foundation Server, Git, or Visual Studio Team Services . Specifically this page looks at two s...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configure-o365api-project-for-distribution
d6713bc831a5-1
When projects are committed to source control, typically the packages are not included as part of the commit because they can add a lot of extra storage space demands and unnecessarily increase the size of a package when sharing it with other developers. Therefore, one of the first tasks developers do after getting a c...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configure-o365api-project-for-distribution
d6713bc831a5-2
Note The previous example references a specific version of the Azure AD Graph client that is known to work with the Office 365 APIs. Future versions may work, so omitting the -Version argument is optional. Clean the web.config file for app-specific details The Office 365 API Tools for Visual Studio add the ab...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configure-o365api-project-for-distribution
d6713bc831a5-3
See also NuGet: App for SharePoint Web Toolkit Office 365 API Client Library NuGet Packages Deploying your SharePoint Add-ins
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configure-o365api-project-for-distribution
f0ff0884aca0-0
This page explains issues that may arise when sharing a SharePoint provider-hosted add-in with other developers or when obtaining a copy from a source control system such as Team Foundation Server, Git, or Visual Studio Team Services . All SharePoint provider-hosted add-ins created by using Visual Studio include a N...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configure-sp-provider-hosted-apps-for-distribution
f0ff0884aca0-1
When projects are committed to source control, typically the packages are not included as part of the commit because they can add a lot of extra storage space demands and unnecessarily increase the size of a package when sharing it with other developers. Therefore, one of the first tasks developers do after getting a c...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/configure-sp-provider-hosted-apps-for-distribution
e1c6a47b5716-0
You can implement timer job functionality by using Microsoft Azure WebJobs or Windows Task Scheduler to perform tasks in SharePoint Online. A timer job is a repetitive, scheduled, background process that runs in SharePoint to perform certain tasks. For example, you may want a timer job to copy data entered in a Sha...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-microsoft-azure-webjobs-with-office-365
e1c6a47b5716-1
When the Azure WebJob runs, the Modified By field stores and displays the value entered in Display name of the organization account. Ensure that you choose a display name that your users can easily identify as the account used by the Azure WebJob for accessing SharePoint. Create and set up the console application...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-microsoft-azure-webjobs-with-office-365
e1c6a47b5716-2
</appSettings> </configuration> Caution App.config stores the organization account's username and password in clear text. This method is used for demonstration purposes only, and should not be used in your production deployment of your Azure WebJobs. We recommend encrypting the password, or authenticating usin...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-microsoft-azure-webjobs-with-office-365
e1c6a47b5716-3
// Add your CSOM code to perform tasks on your sites and content. try { List objList = context.Web.Lists.GetByTitle("Docs"); context.Load(objList); context.ExecuteQuery(); if (objList != null &amp;&amp; objList.ItemCount >...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-microsoft-azure-webjobs-with-office-365
e1c6a47b5716-4
} Publish your console application as an Azure WebJob When you are finished developing your console application, you need to deploy the console application as an Azure WebJob. To deploy your console application as an Azure WebJob, you can: Upload your binaries to an Azure Web App, and create an Azure WebJob ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-microsoft-azure-webjobs-with-office-365
e1c6a47b5716-5
See also Deploying your SharePoint Add-ins
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-microsoft-azure-webjobs-with-office-365
a4aeb7e57fa2-0
When developing any type of web application, most development is done locally using http://localhost . Some projects use local resources or a mix of local and remote resources. Taking these projects from local development environments involves a handful of tasks to perform, such as changing database connection strings...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/move-o365api-project-from-dev-to-prod
a4aeb7e57fa2-1
Tip Make sure you keep a note of the name of the website you create as it will be needed later. Finally click the Create Website link to create the site. Give Azure a few moments to create the site. After creating the site, you can specify app settings through the web interface. This allows you to overr...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/move-o365api-project-from-dev-to-prod
a4aeb7e57fa2-2
Next, choose the APPLICATIONS item in the top navigation. In the Properties section, update the SIGN-ON URL to point to the default URL of the Azure website you created. Take note to use the HTTPS endpoint that is provided with all Azure websites. In the Single Sign-On section, update the App ID ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/move-o365api-project-from-dev-to-prod
a4aeb7e57fa2-3
Replace the values of these settings with a placeholder value: <add key="ida:TenantId" value="set-in-azure-website-config" /> <add key="ida:ClientID" value="set-in-azure-website-config" /> <add key="ida:Password" value="set-in-azure-website-config" /> Save your changes. At this point the web application,...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/move-o365api-project-from-dev-to-prod
a4aeb7e57fa2-4
Test the ASP.NET web application After publishing the web application to the Azure website, Visual Studio opens a browser and goes to the site's homepage. By default this is the HTTP endpoint. Recall from the previous step that when you configured the Azure AD application, you set it to only accept sign-ins from th...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/move-o365api-project-from-dev-to-prod
31fdc7ae512a-0
The articles in this section show you how to deploy your SharePoint Add-ins. Article Shows you how to use the add-in model to Deploy development Office 365 sites to Microsoft Azure This page explains the steps involved in taking an Office 365 API development project and launching it to a working s...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/deploying-your-sharepoint-add-ins
cf35cc8bf34c-0
The Core.ProfilePictureUploader sample shows you how to do a bulk upload of user profile data from either a file share or SharePoint Online URL, and how to link user profile properties to uploaded images. Use this sample to learn how to: Migrate a user's profile pictures from SharePoint Server on-premises to Shar...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-1
Run this sample from Visual Studio Configure the Core.ProfilePictureUploader project with the following command-line arguments: -SPOAdmin Username -SPOAdminPassword Password -Configuration filepath where: Username is your Office 365 administrator's username. Password is your Office 365 administrator's pas...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-2
Additional properties to set on the user's profile by using the additionalProfileProperties element. For example, the following XML specifies an additional user profile property called SPS-PictureExchangeSyncState that should be set to zero on the user's profile when the code sample runs. <additionalProfileProp...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-3
Using the Core.ProfilePictureUploader sample add-in This code sample runs as a console application. When the code sample runs, the Main method in Program.cs does the following: Initializes the console application using SetupArguments and InitializeConfiguration . Calls InitializeWebService to connect t...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-4
if (SetupArguments(args)) // Checks if args passed are valid { if (InitializeConfiguration()) // Check that the configuration file is valid { if (InitializeWebService()) // Initialize the web service end point for the SharePoint Online user profile servi...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-5
LogMessage("Begin processing for user " + sPoUserProfileName, LogLevel.Warning); // Get source picture from source image path. using (MemoryStream picturefromExchange = GetImagefromHTTPUrl(sourcePictureUrl)) { ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-6
InitializeWebService connects to SharePoint Online, and sets a reference of the user profile service to an instance variable. Other methods in this code sample use this instance variable to apply updates to user profile properties. To administer the user profile, this code sample uses the userprofileservice.asmx web s...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-7
// Assign previously created authentication container to admin profile web service. _userProfileService.CookieContainer = authContainer; // LogMessage("Finished creating service object for SharePoint Online Web Service " + adminWebServiceUrl, LogLevel.Information); return...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-8
// Create SharePoint Online Client context to My Site host. ClientContext mySiteclientContext = new ClientContext(_mySiteUrl); SecureString securePassword = GetSecurePassword(_sPoAuthPasword); // Provide authentication credentials using Office 365 authentication. ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-9
ProfilePicture.Seek(0, SeekOrigin.Begin); spImageUrl = string.Format(spPhotoPathTempate, PictureName, "L"); LogMessage("Uploading large image to " + spImageUrl, LogLevel.Information); Microsoft.SharePoint.Client.File.SaveBinaryDirect(mySiteclientContext, spIma...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-10
// Create medium-sized image. using (Stream mediumThumb = ResizeImageSmall(ProfilePicture, _mediumThumbWidth)) { if (mediumThumb != null) { spImageUrl = string.Format(spPhotoPathTempate, PictureName, "M")...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-11
} SetMultipleProfileProperties sets multiple user profile properties in a single method call. In this code sample, SetMultipleProfileProperties sets the following user profile properties for a user: PictureURL - Set to the URL of the medium-sized uploaded image in the picture library on the My Site host. ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
cf35cc8bf34c-12
SetAdditionalProfileProperties sets any additional user profile properties that you want to update after uploading the image files. You can specify additional properties to update in the configuration.xml file. static void SetAdditionalProfileProperties(string UserName) { if (_appConfig.Additiona...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint
66e821cd5d32-0
The Search.PersonalizedResults sample shows you how to personalize SharePoint by filtering information based on the value of a user profile property. Some examples of personalization include: News articles or other content filtered by country or location. Navigation links filtered based on the user's role or orga...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/personalize-search-results-sample-app-for-sharepoint
66e821cd5d32-1
For handling personalization scenarios, you can change the search query by: Reading and testing the value of a user profile property for that user. This code sample tests the About Me property for a value of AppTest . Taking a specific course of action based on the value of the user profile property. For exa...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/personalize-search-results-sample-app-for-sharepoint
66e821cd5d32-2
Retrieves and checks the value of the AboutMe user profile property. If the value of the AboutMe property is AppTest , the search query retrieves all sites by using the query string contentclass:"STS_Site" . If the value of the AboutMe property isn't AppTest , the team site filter is appended to the query str...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/personalize-search-results-sample-app-for-sharepoint