34
votes

I have a couple of CI pipelines that I'm using in Azure DevOps to build some Xamarin apps and I want to create a new one that merges the functionality of the two existing ones. Is there a way to copy or clone an existing pipeline so that I can make changes to the new pipeline without impacting the existing pipelines?

I saw that I can export a pipeline to a JSON file and then import it back in. All of the id values in the JSON file are GUID. Will the import process create new GUIDs or will importing the JSON file overwrite the existing pipeline.

5

5 Answers

35
votes

Click on Pipelines -> Click on your Pipeline -> then click the ellipse in the upper right corner (three vertical dots) then click Clone.

38
votes

UPDATE February 11th, 2020

Not sure if this is a super-recent change, but you can now again easily clone an existing pipeline. From Pipelines, click on the pipeline you want to clone. On the page where the build history is shown, Clone has been moved to the ellipsis menu on this page.

enter image description here

14
votes

UPDATE Feb 2020

Clone is not available anymore. However you can create a new pipeline based on an existing yaml file which is basically cloning.

Pipelines -> New Pipeline -> Configure (3rd page of the wizard) -> Select "Existing Azure Pipelines YAML file"

There you can select the branch and the file you want to use.

1
votes

I know it is too late but easy way around by official document.

Hope that would help some.

0
votes

If you want to use existing stage in another pipeline, do following.

  1. Open the stage 2.Click on three dots at right side of it and select 'Save as template'. 3.In another pipeline, while adding stage, just search with name given at step2.