pnp / custom-learning-office-365

Microsoft Learning Pathways end user learning solution for Microsoft 365 customers.
MIT License
225 stars 207 forks source link

[QUESTION] Update on M365lpConfiguration.ps1 to use a SiteCollection App Catalog #788

Closed flaghub closed 2 months ago

flaghub commented 2 months ago

Hello,

I'm trying to setup the LearningPathway site but I'd like the App to only be visible on that site. I've created the SiteCol App Catalog, published the sppkg to the sitecol app catalog and added the App to the site.

Now, I try to do the initial setup with the powershell script (M365lpConfiguration.ps1) Is there a version compatible with the SiteCol App Catalog approch?

If not, what part of the script should I change? I have some knowledge on PowerShell but not enough to make It work with our needs.

Thanks

dcashpeterson commented 2 months ago

@flaghub The installation script doesn't install the app in the app catalog (tenant app catalog or site collection app catalog). You need to do that manually. The scripts are used to configure the properties you need and set up admin and viewer webparts and lists etc. Are you getting an error?

flaghub commented 2 months ago

@dcashpeterson No probem to deploy the app to the site-col app catalog with this method: https://www.sharepointdiary.com/2019/08/sharepoint-online-enable-site-collection-app-catalog-using-powershell.html

We updated the script to acces the site-col app catalog and not the Tenant App catalog.

We do have an issue with the Set-PnPStorageEntity method inside the script. The definition (https://pnp.github.io/powershell/cmdlets/Set-PnPStorageEntity.html) shows that we can add "-Scope Site"

But in the real world, this line throw an error: Set-PnPStorageEntity -Key MicrosoftCustomLearningCdn -Value "https://pnp.github.io/custom-learning-office-365/learningpathways/" -Description "Microsoft 365 learning pathways CDN source" -ErrorAction Stop -Scope Site

Error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

dcashpeterson commented 2 months ago

@flaghub you need to be a tenant admin to run that script and set the properties at the tenant level. If you don't set the properties at the tenant level the application may not work. You should have a tenant admin run the script.

dcashpeterson commented 2 months ago

closed as answered

github-actions[bot] commented 1 month ago

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.