0

I'm looking for an automated way for adding & deploying SPFX solution package (*.sppkg) into the SharePoint 2019 (NOT online) app catalog. This is cause and doing the deploying using azure devops (CI/CD) release pipeline.

I found those two below tasks for adding this package:

  • The first one worked fine in just adding the file to the app catalog but not deploying it, so I had to do it manually.
  • The second task has the option to write PnP script against SharePoint, but the problem with me is that most of the scripts i found are for SharePoint Online not on premise.

Appreciate your support if you had such situation and got it solved using PnP or something else.

enter image description here

  • Did you ever figure out a solution for this? I am on a similar path now, needing to automate deployment to SP2019 using Azure DevOps release pipeline. – Arin Zandbergen Apr 02 '22 at 02:37

2 Answers2

0

Microsoft's official documentation describes an approach to continuous deployment using Azure DevOps. You can click Implement Continuous Integration and Continuous deployment using Azure DevOps for detailed information. There is no need to write PNP scripts using this method.

Setting up Azure DevOps for Continuous Deployments with a SharePoint Framework solution requires the following steps:

  1. Creating the Release Definition

  2. Linking the Build Artifact

  3. Creating the Environment

  4. Installing NodeJS

  5. Installing the CLI for Microsoft 365

  6. Connecting to the App Catalog

  7. Adding the Solution Package to the App Catalog

  8. Deploying the Application

  9. Setting the Variables for the Environment

If you just want to use Azure DevOps CD and don't want to use CI, you can skip the second step and upload your build artifacts directly to the repository, and then use them in the release pipeline.

Jane Ma-MSFT
  • 4,461
  • 1
  • 6
  • 12
  • Actually @Jane , I was following this article but when came across the deployment steps, it's targeting SPO not SP 2019 on premise like my case and as mentioned in my question. The mentioned commands on article are targeting SPO – Hazem Abdelwahab Mar 11 '21 at 09:08
0

There are some basic scenarion for using pipelines:

  1. You use cloud pipeline (azure, github, etc) with their abilities and their purpuse.
  2. You create own environment with self-hosted pipelines
  3. You add own runner (pipeline agent) to your cloud (azure) environment

So, azure allows you to add own pipeline agent to environment. For example, self-hosting windows agent.

So, I think solution in your case will be:

  • Install self-hosted agent
  • Configure agent environment - installing SharePointPnPPowerShell2019
  • Add agent to your azure environment
  • Add step to deploy your solution into pipline with using self-hosted agent

This scenario allows you to deploy sppkg solutions without publish your app catalog to internet, because your self-hosted agent will be in the save network as your sharepoint farm.

Azure pipeline deploy steps allow to run powershell on target machines

Prerequisites This task uses Windows Remote Management (WinRM) to access on-premises physical computers or virtual computers that are domain-joined or workgroup-joined.

Maxim
  • 854
  • 1
  • 8
  • 16