pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

AppPackageId token does not get resolved within the Site Scipts #2183

Open Zerg00s opened 5 years ago

Zerg00s commented 5 years ago

Note: Sorry if it is more related to PnP Core. I can re-create this issue there, if that's the case.

AppPackageId does not get resolved when using Apply-PnPProvisioningTemplate

Run these PowerShell PnP commands:

Connect-PnPOnline -Url https://zergs-admin.sharepoint.com
Apply-PnPProvisioningTemplate -Path ./PnP_TenantDesign.xml
$script = Get-PnPSiteScript | Where-Object {$_.Title -eq "SPFx Install Script"}
Get-PnPSiteScript -Identity $script.id | fl

You will see that {AppPackageId:SPFxInstall} token is not replaced

Content : { "$schema": "schema.json", "actions": [ { "verb": "installSolution", "id": "{AppPackageId:SPFxInstall}" } ], "version": 1 }

Expected behavior

When running these commands

Apply-PnPProvisioningTemplate -Path ./PnP_TenantDesign.xml
$script = Get-PnPSiteScript | Where-Object {$_.Title -eq "SPFx Install Script"}
Get-PnPSiteScript -Identity $script.id | fl

We expect to see {AppPackageId:SPFxInstall} token replaced with an actual ID of the app that is available in the App Catalog.

Actual behavior

As a result, when applying the new site design, step responsible for installing SPFx solutions fails with an error:

2019-07-23T14:20:05.8810780Z Title OutcomeText Outcome 2019-07-23T14:20:05.8811469Z ----- ----------- ------- 2019-07-23T14:20:05.8811797Z Install SPFX Solution Something went wrong and we could not complete

Steps to reproduce behavior

See complete example here: https://github.com/Zerg00s/PnP-Site-Design-SPFxInstall

Which version of the PnP-PowerShell Cmdlets are you using?

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

3.11.1907.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 5 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.