Prerequisites
- If you have any variable group defined and used in source build make sure to crate the variable groups with same name in the target team project.
- If any task groups are used export and import them to the new team project. There may be extensions that you may want to install for the target team project if it is a different Azure DevOps organization.
With above prerequisites fulfilled, you can use export in builds tab to export a definition as a json file.
Then go to new team project and click new and import. If you do not have any build definitions you will not see the view shown below. Create a dummy build definition temporarily in that case.
After importing the build definitions you ma have to fix following items.
- Agent pool – you have to select the relevant pools.
- Fix source location and authorize to get source code.
- Fix any service connections used in tasks.
The request specifies project ID <target project guid> but the supplied pipeline specifies project ID <source project guid>.
To fix this open the exported json file in a notepad and search for source project guid and replace it with target project guid. you do nt have to fix any other part of this file such as URLs referring the source team project and Azure DevOps organization.
However, if you want to find the project guides before running into the errors you can do it using REST api call. Replace your Azure DevOps organization name and team project name in below url and run it in a browser to get the project Id. This way you can avoid the project Id error when trying to save imported build definition from a different team project.
https://dev.azure.com/yourorgname/_apis/projects/teamprojectname?api-version=5.0
No comments:
Post a Comment