SharePoint Framework -solution deployment options

Deployment Options
0

There are various options to package and deploy a SPFx solution and as part of packaging and deployment process.

SPFx package deployment consists of below components that need to be deployed:

  1. The minified js file for all code
  2. The webpart manifest file
  3. Webpart compiled file
  4. The package file with all package information

Deployment Options:

The packaged solution (.sppkg) file should be deployed in App catalog site. The assets of the package (1-3 of above) could be deployed by any of the four below options.

Include Include as part of Solution Package (Deploy to ClientAssets in App Catalog)

From SPFx version 1.4, it is possible to include assets as part of the package file and deploy it to the hidden ClientAssets library residing in App Catalog. It is set in the package-solution.json file “includeClientSideAssets”: true. Please find deployment process link here

Advantages:

  • No extra steps needed to package and deploy assets

Disadvantages:

  • Increases the payload of the package file
  • Risk for Tenant admins to deploy script files to the Tenant App Catalog.

Deploy to SharePoint document library

This is also an option to copy compiled assets to a SharePoint document library anywhere in the tenancy. Set the setting “includeClientSideAssets”: false in package-solution.json file and then set the CDN details in write-manifests.jsonfile. Please find deployment process link here

Advantages:

  • No need of additional Azure hosting or enabling Office 365 CDN
  • Access to Assets files from SharePoint interface

Disadvantages:

  • Manual Copy of assets file to SharePoint library
  • Accidental deletion could cause issues

Deploy to Office 365 Public CDN

Enable and set up Office 365 CDN in your tenancy before deployment.  Please find deployment process link here

Advantages:

  • Faster access to assets and web part resources because of CDN hosting
  • No Azure subscription requirement
  • Content is accessible from SharePoint Interface

Disadvantages:

  • Manual copy of assets files to CDN enabled SharePoint library
  • Office 365 CDN is a tenant setting and must be enabled for the entire tenancy
  • Since the assets are deployed to a CDN endpoint, so if assets need restricted access then this mayn’t be recommended.
  • Accidental deletion could cause issues

Deploy to Azure CDN

The assets could be deployed to an Azure CDN. The deployment script is already a part of SPFx solution and could be done from within the solution. Please find deployment process link here

Advantages:

  • Easy deployment using gulp
  • Faster access to assets and web part resources because of CDN hosting
  • Add geographical restrictions.

Disadvantages:

  • Dependency on Azure Subscription
  • Proper set up steps required for setting up Azure CDN.
  • Since the assets are deployed to a CDN endpoint, so if assets need restricted access then this mayn’t be recommended.

0

You may also like

1 Comment

  1. Just desire to say your article is as astounding.

    The clarity to your submit is simply spectacular and i can assume you are
    an expert on this subject. Fine along with your permission allow me to snatch your RSS feed
    to keep updated with drawing close post. Thanks
    a million and please keep up the enjoyable work.

    0

Leave a Reply

Your email address will not be published.