怎样在Azure DevOps创建一个pipeline

You learned how to set up Azure Pipelines in an earlier module. If you need a refresher, head over to Create a build pipeline with Azure Pipelines .

Since your solution has just the one project in it, the scope of the job agent is limited and cannot access the package. To make sure the agent has the permissions it needs to publish the artifact, you need to turn off Limit job authorization scope to current project in the pipeline settings.

To turn off this setting:

  1. In Azure DevOps, navigate to your organization.

  2. Select Organization settings from the bottom corner.

  3. Under Pipelines, select Settings.

  4. Turn off Limit job authorization scope to current project.

    怎样在Azure DevOps创建一个pipeline

You need to make a similar change to your project:

  1. From Azure DevOps, go to the Space Game - web - Dependencies project.
  2. Select Project settings at the bottom left.
  3. Under Pipelines, select Settings
  4. Turn off Limit job authorization scope to current project.

Next, you'll set up a second pipeline to build the package and upload that package to Azure Artifacts.

  1. From Azure DevOps, go to the Space Game - web - Dependencies project.

  2. Select Pipelines, from the menu on the left.

  3. Select + New Pipeline.

  4. From the Connect tab, select GitHub.

  5. From the Select tab, select mslearn-tailspin-spacegame-web-models.

    If prompted, enter your GitHub credentials. From the page that appears, scroll to the bottom and select Approve and install.

  6. From the Review tab, you see the new pipeline's azure-pipelines.yml file.

  7. Select Run.

  8. Watch the pipeline run.

  9. Go to the Artifacts tab.

  10. From the dropdown at the top, select Tailspin.SpaceGame.Web.Models.

    怎样在Azure DevOps创建一个pipeline

    You see the resulting package, Tailspin.SpaceGame.Web.Models, in Azure Artifacts.

    怎样在Azure DevOps创建一个pipeline

  11. Select the package to go to the details page. Then copy the version number to a location where you can easily access it later.

    怎样在Azure DevOps创建一个pipeline

    You'll use this version number in the next part.

 

 

原文:

https://docs.microsoft.com/zh-cn/learn/modules/manage-build-dependencies/5-create-package-pipeline

Create the pipeline in Azure Pipelines