Skip to content

Apply a DevOps process to your SPFx project (Part 2)

Goal of this article (reminder)

This article series will show how to apply a DevOps process by using tools like Azure DevOps or GitHub Actions, using multi-stage / environment pipelines to deploy on environments such as UAT, in order to validate an improvment or a hotfix before going to production.

The second part will focus on SharePoint Online scenarios where you can start from, when applying CI / CD pipeline.

Scenarios context

When working on enterprise solutions, we are always facing the question of "testing" before pushing on production environment, to ensure that new features or fixes are working as expected.

Thanks to the site collection app catalog, we have this opportunity (for the use cases exposed in the previous part)!

Whether the production environment app catalog is a site collection or a tenant one, the test site (which we'll call "UAT") will target a site collection app catalog to isolate the tests and approve the solution's new version before deploying on production

Remember when I've previously talked about the presence of a same solution package in both tenant and site collection app catalog? Well for the below scenarios, the priority order will matter, because you will have the opportunity test out new features or bug fixes in an isolated environment, using the same solution package name and SharePoint component added to the site, without having to rename it!

DevOps priority order

You'll find below two approaches I propose which you can start from, based on your business needs.

Existing testing site

The first case states that there's already an existing UAT site with site collection app catalog enabled.

The pipeline will build the solution and deploy it on the test site, with approval as a prerequisite.

Then, once the tests successfully validated, a new approval will be required in order to deploy on the production environment.

DevOps existing UAT

Ephemeral testing site

The second case states that there will be an ephemeral testing site, created only to test the solution and after approval and deployment on the production site, will be removed.

The pipeline will :

  • build the solution
  • connect to the production site to gets its template (with the PnP Povisioning Engine)
  • create a site with the same template as the production one (called UAT)
  • add a list structure & content to this template
  • apply the production site template on the UAT site and enable the site collection app catalog
  • deploy the solution on the UAT site (with approval)
  • (optionally) add a test page which includes the WebPart to be tested

Again, once the tests successfully validated, a new approval will be required in order to deploy on the production environment.

DevOps ephemeral UAT

The next part will focus on technical solutions that will cover those scenarios, stay tuned 😉

Apply a DevOps process to your SPFx project (Part 1)

Apply a DevOps process to your SPFx project (Part 2)

Apply a DevOps process to your SPFx project (Part 3)