Update to my Azure Pipelines Templates for SPFx Projects (v1.4.0)

By Last Updated: October 6, 2024 3 minutes read

I’ve updated our Azure Pipelines Templates for SharePoint Framework projects earlier today. This release, v1.4.0, is mostly a modernization update to the templates for developers using our templates to implement a CI/CD process for their SharePoint Framework (SPFx) projects using Azure DevOps Pipelines.

Successful pipeline execution from the updated 'Azure Pipelines Templates SPFx'

Successful pipeline execution from the updated 'Azure Pipelines Templates SPFx'

What’s in this update

Demonstrating the consistency of Azure DevOps Pipelines, I was happy to see that I didn’t have much to do to bring the templates up to date. The primary change involved replacing the now outdated Office 365 CLI with the renamed CLI for Microsoft 365. This only impacted four of the steps in the deployment template (see the changes here) that used the CLI, including:

  • Install CLI for Microsoft 365
  • Sign into Microsoft 365
  • Upload SharePoint package to Site Collection App Catalog
  • Deploy SharePoint package

The only other change in this update is that I refreshed the sample project in the repo to be the current published version of the SharePoint Framework, v1.12.1

If you want to see everything that changed from the previous release (v1.3.0) and this release, check the tagged history in the repo. Most of the changes are from upgrading the sample project in the repo.

Breaking change

There is a collection of breaking changes you should account for the update to use the renamed CLI. All references to the “Office 365 CLI”, “Office 365”, or “O365” were renamed to the “Microsoft 365” equivalent.

While it seems cosmetic, the this did result in changes to the input parameters for the deployment template (see the changes in this diff).

So now, your deployment template reference will look more like the following. Note the o365 prefix has been replaced with m365:

# azure-pipelines.yml
- stage: Deploy
  dependsOn:
    - Build
    - Test
  jobs:
    - template: jobs/deploy.yml@azure-pipelines-spfx-templates
      parameters:
        target_environment: development
        m365_user_login: [email protected]
        m365_user_password: <password>
        m365_app_catalog_site_url: https://contoso.sharepoint.com/sites/AppCatalog
        m365cli_app_catalog_scope: tenant
        m365cli_deploy_extra_arguments: '--skipFeatureDeployment'

Upgrading your projects

Are you currently using these templates for your projects? If so, I hope you’ve been following the guidance in the docs, specifically the section on README: Consider Referencing Specific Template Versions.

In that guidance, I recommend you only reference a specific release version in your project. This way, when the templates are updated, if there’s a breaking change it won’t impact you. For example, to use this version, you should reference the v1.4 tag in your pipeline:

# azure-pipelines.yml
resources:
  repositories:
  - repository: azure-pipelines-spfx-templates
    type: github
    name: voitanos/azure-pipelines-spfx-templates
    ref: refs/tags/v1.4.0
    endpoint: github

This allows you to implement and address any breaking changes on your timeline, not when the source project is updated.