Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Automated deployment of your SharePoint Framework solution to Office 365 CDN

The sample provide a Powershell script to include in your SharePoint Framework solution which allow to have an automated deployment on Office 365 CDN


In order to use properly this script, is necessary install the PnP Powershell

How to use it

  • Include the powershell files DeploySPFxToO365CDN.ps1 and DeploySPFxToAppCatalog.ps1 directly into the root of your SharePoint Framework solution. The first file uploads the SPFx bundle on Office 365, the second uploads and deploys the sppkg into the App Catalog.

  • Run the following commands in order to download the Powershell scripts:

Save-Script -Name VSTS.DeploySPFxToO365CDN -Path <root SPFx path>
Save-Script -Name VSTS.DeploySPFxToAppCatalog -Path <root SPFx path>
  • Setup the Office 365 CDN url cdnBasePath in the write-manifest.json.

  • Fill out the parameters contained in the configuration comments of DeploySPFxToO365CDN.ps1 and DeploySPFxToAppCatalog.ps1:

    Parameter Value
    $cdnSite https://<tenant>
    $cdnLib <Document Library Name>
    $catalogSite https://<tenant>
  • Run gulp bundle --ship

  • Run gulp package-solution --ship

  • Run DeploySPFxToO365CDN.ps1, set the windows credential manager on your machine to avoid the Office 365 login everytime. more detail here

  • Run DeploySPFxToAppCatalog.ps1 and your SPFx solution is ready to go

You can also include these scripts in your TFS and configure properly the variables about the release definitions

For More Info Read My Blog Post

In order to configure the continuous integration and deployment on Visual Studio Team Services, follow the steps on my blog post

use the following files:

  • VSTS.DeploySPFxToAppCatalog.ps1
  • VSTS.DeploySPFxToO365CDN.ps1

Demo available here: