Skip to content

Adds Azure DevOps guidance and updates GitHub Actions guidance. Closes #5879 #6663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Adam-it
Copy link
Member

@Adam-it Adam-it commented Mar 20, 2025

Closes #5879

@Adam-it Adam-it closed this Apr 25, 2025
@Adam-it Adam-it deleted the updates-ci-cd-docs branch April 25, 2025 21:01
@Adam-it Adam-it restored the updates-ci-cd-docs branch April 25, 2025 21:07
@Adam-it Adam-it reopened this Apr 25, 2025
@Adam-it
Copy link
Member Author

Adam-it commented Jun 2, 2025

I will set this as draft as I guess now it makes more sense to update this to latest version of SPFx so for Node 22.
Currently the examples use Node 18

@Adam-it Adam-it marked this pull request as draft June 2, 2025 15:20
@Adam-it Adam-it marked this pull request as ready for review June 2, 2025 21:30
@martinlingstuyl
Copy link
Contributor

Should we also change this so that it's based on federated identity? Seems like the best thing to do...

@Adam-it
Copy link
Member Author

Adam-it commented Jun 8, 2025

Should we also change this so that it's based on federated identity? Seems like the best thing to do...

Yes that would make sense. But I wonder would it first make sense to update m365 spfx project github workflow add and m365 spfx project azuredevops pipeline add to support scaffolding pipelines with federated identity 🤔
it has been some time already since this PR was opened 😅

@Jwaegebaert Jwaegebaert self-assigned this Jul 22, 2025
@Jwaegebaert Jwaegebaert requested a review from Copilot July 22, 2025 06:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive Azure DevOps pipeline guidance for CLI for Microsoft 365 and updates the GitHub Actions documentation with newer versions. The changes enhance CI/CD documentation by expanding coverage to include Azure DevOps alongside existing GitHub Actions support.

  • Adds complete Azure DevOps pipeline tutorial with authentication setup and deployment workflows
  • Updates GitHub Actions documentation with newer action versions and improved titles
  • Reorganizes sidebar positioning to accommodate the new Azure DevOps guidance

Reviewed Changes

Copilot reviewed 7 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
azuredevops-pipeline.mdx New comprehensive guide for setting up CLI for Microsoft 365 in Azure DevOps pipelines
github-actions.mdx Updates action versions and improves titles/headings for clarity
using-proxy-url.mdx Sidebar position updated to accommodate new content
using-cli-vs-code-extension.mdx Sidebar position updated to accommodate new content
using-cli-context.mdx Sidebar position updated to accommodate new content
use-cli-api.mdx Sidebar position updated to accommodate new content
manage-microsoft-365-apps.mdx Sidebar position updated to accommodate new content

command: install
```

The above part is just a standard setup of Node version we will be using. Currently v18 as this is the latest version we may use for the currently latest version of SPFx which as of now is 1.20.0. Next we are running `npm install` to install all the dependencies of the project.
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation mentions Node v18 but the YAML example shows Node 22.x. This inconsistency could confuse users about which Node version to use.

Copilot uses AI. Check for mistakes.


![Azure DevOps Navigation](../images/azure-devops-pipeline-tutorial/ado-menu.png)

Next in the top right corner of the page hit on the `New pipline` button. After that follow the for by selecting the location of your repo, next the branch on which the YAML file is present, and then select the option to create a new pipeline based on `Existing Azure Pipelines YAML file`
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'pipline' should be 'pipeline' and 'follow the for by' appears to have a grammatical error and should be 'follow the form by'.

Suggested change
Next in the top right corner of the page hit on the `New pipline` button. After that follow the for by selecting the location of your repo, next the branch on which the YAML file is present, and then select the option to create a new pipeline based on `Existing Azure Pipelines YAML file`
Next in the top right corner of the page hit on the `New pipeline` button. After that follow the form by selecting the location of your repo, next the branch on which the YAML file is present, and then select the option to create a new pipeline based on `Existing Azure Pipelines YAML file`

Copilot uses AI. Check for mistakes.


The next thing we need is to set up the authentication for the CLI for Microsoft 365. In order to for CLI for Microsoft 365 to be able to deploy an SPFx package from Azure DevOps build artifacts to your SharePoint Online tenant it will need to authenticate as an app, yes as an app, otherwise we would need to use user credentials, and most probably confirm the MFA popup for authentication every time the pipeline runs which is for sure a no go. First, we will need to create an app registration in Entra ID portal and then create a certificate and upload it to the app registration. After that we will need to grant the app registration the necessary permissions in order to be able to deploy the SPFx package to the tenant app catalog. We could do that all manually but luckily for us we may do all that with just a few lines of code using CLI for Microsoft 365.

First, let's create a new certificate which we will need to add to our app req and later on use in the pipeline for authentication. There are many ways to go about it but if you are using PowerShell you may use the following script to create a new certificate:
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'app req' should be 'app registration' for clarity and consistency.

Suggested change
First, let's create a new certificate which we will need to add to our app req and later on use in the pipeline for authentication. There are many ways to go about it but if you are using PowerShell you may use the following script to create a new certificate:
First, let's create a new certificate which we will need to add to our app registration and later on use in the pipeline for authentication. There are many ways to go about it but if you are using PowerShell you may use the following script to create a new certificate:

Copilot uses AI. Check for mistakes.


After we created our app registration we could just update the yaml file of the pipeline with the values of the variables that we need to use in the pipeline. But that is not the best approach as the certificate password and the certificate base 64 encoded string will be just visible in the yaml file as plain text and also be part of your git history. In order to avoid that we may use Azure DevOps Library to store the values of the variables in a secure way and use the library in our pipeline. Lets go over the steps of how to do that.

First, we will need to go to Azure DevOps Pipelines Library page and click on `+ Variable group` button. After that, we will only need to specify the name of our group and we may start by adding variables to it. There are many things you may leverage to make your variables secure like integrating with Azure key vault or specifying a security Azure DevOps group that will only have edit access to the variable group. For the sake of simplicity we will just add the variables to the group and the once that are considered confidential, like password, we will mark them as secret.
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'the once that are' should be 'the ones that are'.

Suggested change
First, we will need to go to Azure DevOps Pipelines Library page and click on `+ Variable group` button. After that, we will only need to specify the name of our group and we may start by adding variables to it. There are many things you may leverage to make your variables secure like integrating with Azure key vault or specifying a security Azure DevOps group that will only have edit access to the variable group. For the sake of simplicity we will just add the variables to the group and the once that are considered confidential, like password, we will mark them as secret.
First, we will need to go to Azure DevOps Pipelines Library page and click on `+ Variable group` button. After that, we will only need to specify the name of our group and we may start by adding variables to it. There are many things you may leverage to make your variables secure like integrating with Azure key vault or specifying a security Azure DevOps group that will only have edit access to the variable group. For the sake of simplicity we will just add the variables to the group and the ones that are considered confidential, like password, we will mark them as secret.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration of the CLI within an Azure DevOps Pipeline
4 participants