Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
One approach to creating a pipeline is to copy an existing pipeline and use it as a starting point. For YAML pipelines, the process is as easy as copying the YAML from one pipeline to another. For pipelines created in the classic editor, the procedure depends on whether the pipeline to copy is in the same project as the new pipeline. If the pipeline to copy is in the same project, you can clone it, and if it is in a different project you can export it from that project and import it into your project.
If your new pipeline can be created by copying another classic pipeline in the same project, follow the instructions in this section. If your pipeline is in another project, you can use import/export to copy the pipeline.
You need Edit release pipeline or Edit build pipeline permissions to clone a Classic pipeline.
Navigate to the pipeline details page for your pipeline.
Choose ... and select Clone.
Your pipeline is cloned with -clone appended to the name. Choose Save or Save & queue to save the cloned pipeline.
Note
The Clone entry is only present on the context menu if your pipeline was created in the classic editor.
Export and Import a pipeline
You can create a new classic pipeline by exporting an existing one and then importing it. This is useful in cases where the new pipeline has to be created in a separate project.
In a YAML pipeline, exporting from one project and importing into another is the same process as cloning. You can simply copy the pipeline YAML from the editor and paste it into the YAML editor for your new pipeline.
Navigate to your pipeline, and choose Edit.
Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.
To copy a build definition from another project, you can export an existing definition from that project, and then import it.
Build pipeline
Navigate to the pipeline details page for your pipeline.
Choose ... and select Export to JSON.
When prompted, save the JSON file on your local machine. The browser will save the file in the download directory as per your browser settings.
To import the pipeline, navigate to the Pipelines page in your project. Choose ..., select Import a pipeline, and select the corresponding import pipeline option.
You will now be prompted to select a JSON file to import its contents. Browse to and select the JSON file that you previously exported.
After import is complete, you will be shown the new pipeline that is created. Note that exporting a pipeline strips any project specific data like agent pools, service connections etc. You will have to once again provide these details.
Note
The Export item is only present on the context menu if your pipeline was created in the classic editor.
Release pipeline
The procedure for exporting and importing a classic release pipeline is very similar to the classic build pipeline procedure, but the menus and UI are slightly different.
To export a classic release pipeline, navigate to Releases, choose ..., and select Export.
To import a classic release pipeline, navigate to Releases, choose +New, and select Import release pipeline.
Navigate to the pipeline details page for your pipeline.
Choose ... and select Export.
When prompted, save the JSON file on your local machine. The browser will save the file in the download directory as per your browser settings.
To import the pipeline, navigate to the Builds or Releases page in your project. Choose +New and select the corresponding import pipeline option.
You will now be prompted to select a JSON file to import its contents. Browse to and select the JSON file that you previously exported.
After import is complete, you will be shown the new pipeline that is created. Note that exporting a pipeline strips any project specific data like agent pools, service connections etc. You will have to once again provide these details.
Note
The Export item is only present on the context menu if your pipeline was created in the classic editor.