SharePoint 2019 SPFX Tenant Wide Deployment

alchemicdreams 136 Reputation points
2020-09-11T14:44:48.223+00:00

I am looking for some advice / confirmation regarding SPFX on SP2019. I have followed multiple guides online including from the Microsoft site to try and deploy an application customizer extension (to inject some simple css) into all modern pages.

The extension works fine in testing and if deployed without the tenant wide option selected e.g. then adding the extension to individual sites manually. However when I try to deploy globally it doesn't do anything. If I register the extension with Add-PnPCustomAction (in various different scripts!) I can see the action is registered with the site but again it doesn't doing anything.

During my researching I found a few forum threads and such from last year which suggest that on-premises SP2019 does not support tenant wide deployment of extensions. Is this still the case in September 2020? Am I wasting my time here? If the answer is yes, does anyone know if Microsoft has plans to fix the situation? I was one of the champions of bringing in SP2019 to our org rather than the 2016 version on the basis that modern experience was a winner, but now it seems that there is no simple way for us to do simple tweaks like we could in classic.

Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. alchemicdreams 136 Reputation points
    2020-09-14T08:36:13.667+00:00

    Indeed that is one of the threads I had read already where it was said that it wasn't possible to deploy globally. Fortunately I have managed to make it work through another couple of hours of trial and error. Most guides I've read (including from the microsoft site) didn't really go into the finer details of the SP PnP PowerShell command you need to run to get it to deploy the extension on all sites in SP19.

    Ultimately it WAS simple in the end. I'm really confused about why Microsoft haven't made this detail more easily available in their SPFX documentation pages, especially around highlighting what needs to be done in SP19 on prem vs. SPO. Anyway I'll leave this here for anyone else who happens to stumble across my question here. The full command I ran with SP19 PnP PowerShell whilst logged in as an account with the required permissions was:

    Connect-PnPOnline -Url <siteURL> -CurrentCredentials
    Add-PnPCustomAction -Title "<Title>" -Name "<Name>" -Location "ClientSideExtension.ApplicationCustomizer" -ClientSideComponentId <Id> -ClientSideComponentProperties "{""cssurl"":""url_for_css.css""}" -Scope Site

    The ClientSideComponentId can be found in your classname.manifest.json file. Note that the extension was uploaded to the app catalog site for the web app first and the checkbox to deploy globally was ticked.

    My extension was based on this one here https://tahoeninjas.blog/2018/05/08/inject-custom-css-on-sharepoint-modern-pages-using-spfx-extensions/.

    Hope someone finds this useful.


2 additional answers

Sort by: Most helpful
  1. trevorseward 11,711 Reputation points
    2020-09-11T21:41:15.81+00:00

    SharePoint Server 2019 will not have feature changes like this during the remainder of the lifecycle of the product. If this is important to you, you may want to create a post at sharepoint.uservoice.com.

    0 comments No comments

  2. Amos Wu-MSFT 4,131 Reputation points Moderator
    2020-09-14T02:56:16.533+00:00

    As @trevorseward said,SharePoint 2019 does not support this.
    Here is a similar issue,you could try the workaround in it. https://github.com/SharePoint/sp-dev-docs/issues/3590

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.