You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/declarative-customization/site-design-pnp-provisioning.md
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
title: Calling the PnP provisioning engine from a site script
3
3
description: Build a complete SharePoint site design using the PnP provisioning engine
4
-
ms.date: 07/04/2020
4
+
ms.date: 11/25/2020
5
5
localization_priority: Priority
6
6
---
7
7
8
8
# Calling the PnP provisioning engine from a site script
9
9
10
10
> [!NOTE]
11
-
> This article uses a version of PnP PowerShell that is currently in pre-release and planned to GA in January 2021. As Azure Functions run PowerShell Core, you will have to use this version of PnP PowerShell in your Azure function. For more information about this version of PnP PowerShell see https://pnp.github.io/powershell.
11
+
> This article uses a version of PnP PowerShell that is currently in pre-release and planned to GA in January 2021. As Azure Functions run PowerShell Core, you'll have to use this version of PnP PowerShell in your Azure Function. For more information about this version of PnP PowerShell see https://pnp.github.io/powershell.
12
12
13
13
Site designs offer a great way to standardize the look and feel of your site collections. However, you can't do some things with site designs, like add a footer to every page. You can use the PnP provisioning engine to create a template that you can use to provision an Application Customizer to a site. This Application Customizer can then update your page design, for example to register a footer on every page.
14
14
@@ -25,7 +25,7 @@ The steps in this article use the following components:
25
25
- A PnP PowerShell script
26
26
- An Azure AD App Registration
27
27
28
-
You will use these components to trigger the PnP provisioning code after you create the site and apply the site design.
28
+
You'll use these components to trigger the PnP provisioning code after you create the site and apply the site design.
Replace **contoso.onmicrosoft.com** with your tenant.
42
43
43
44
Follow the steps carefully.
44
45
45
46
As a result of the command a new Azure AD Application will be registered, permissions will be set correctly, and you will have provided consent to use this application in your tenant. Notice that you require write access to the Azure AD for this.
46
-
1. Copy the values the cmdlet returns as you will need the pfx file and the AzureAppId value later.
47
-
<br/>
48
47
48
+
1. Copy the values the cmdlet returns as you will need the pfx file and the AzureAppId value later.
49
49
50
50
## Create the Azure Queue storage
51
51
@@ -62,7 +62,6 @@ To set up the Azure Queue storage:
62
62
1. Enter **pnpprovisioningqueue** for the name, or enter your own value; be sure to follow the naming standard. Make note of the queue name; you will need this value when you create the Azure Function.
63
63
1. Go to **Access Keys** and note the **Storage Account Name** and the **key1 Key value**. You will need these values when you create the flow.
64
64
65
-
66
65
## Create the flow
67
66
68
67
To put a message in the queue, you need to create a flow.
@@ -106,7 +105,7 @@ To put a message in the queue, you need to create a flow.
106
105
1. Choose the first step in your flow ('When an HTTP request is received') and copy the URL.
107
106
1. Save your flow.
108
107
109
-
Your flow should look like the following.
108
+
Your flow should look like the following:
110
109
111
110

Invoke-RestMethod -Uri $uri -Method Post -ContentType "application/json" -Body $body
121
120
```
122
121
123
-
When you go to the main screen of your flow, you will see a run history. If your flow worked correctly, it will show `Succeeded`.
122
+
When you go to the main screen of your flow, you'll see a run history. If your flow worked correctly, it will show `Succeeded`.
124
123
Now go to the queue you just created in Azure and choose **Refresh**. You should see an entry that shows that you correctly invoked the flow.
125
124
126
125
## Provision the SPFx solution
@@ -157,11 +156,14 @@ Copy the following provisioning template XML to a new file and save the file as
157
156
1. Search for **Function App** and create a new function app. In the **Storage** field, select **Use existing**, and select the storage account that you created earlier. Set the other values as required, but make sure to select **PowerShell Core** as the **Runtime** and select **7.0** as the **Version**
158
157
159
158

159
+
160
160
1. When created, navigate to your new Function App
161
161
1. Select **App Files**
162
162
163
163

164
+
164
165
1. In the dropdown menu, select **requirements.psd1** and add a new entry as follows
166
+
165
167
```powershell
166
168
# This file enables modules to be automatically managed by the Functions service.
167
169
# See https://aka.ms/functionsmanageddependency for additional information.
@@ -173,7 +175,7 @@ Copy the following provisioning template XML to a new file and save the file as
173
175
'PnP.PowerShell' = '0.2.17-nightly'
174
176
}
175
177
```
176
-
Save the file. Notice, that if you do no intent to use the Azure PowerShell Cmdlets you can remove that entry from this file. The requirements.psd1 file makes sure that specific PowerShell modules will be available to all functions. At the first execution of the Azure Function these modules will be downloaded and made available. You can also use wildcard references for the version. See for more information about this file here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell?tabs=portal#dependency-management
178
+
Save the file. Notice, that if you do no intent to use the Azure PowerShell Cmdlets you can remove that entry from this file. The requirements.psd1 file makes sure that specific PowerShell modules will be available to all functions. At the first execution of the Azure Function these modules will be downloaded and made available. You can also use wildcard references for the version. See for more information about this file here: https://docs.microsoft.com/azure/azure-functions/functions-reference-powershell?tabs=portal#dependency-management
177
179
178
180
1. Create a new Azure Function **Functions** > **Add**:
0 commit comments