Crafting a Release Pipeline json to use as template

Copper Contributor

We are running Azure DevOps Server 2020 on-premise. My understanding is that YAML pipelines are not currently available for Release Pipelines. For the time being, I would like to craft a JSON template to use to create Release Pipelines (Definitions) using the API. I have exported an existing Release JSON and tried working with that to create a new Release with Environments/Tasks/Variables, etc., but haven't been able to get it work. When I do get it to create something, it only gets as far as creating a nearly empty Release, but does not configure an Agent Pool, as well as any Tasks. I do not see anything in the JSON I exported related to the Agent Pool and the lack of this may be causing the Tasks creation to fail. Also, when I try some different structures within the JSON, I sometimes get this error:
"Invalid property DeployPhases used in stage 'PROD'. Instead, use DeployStep for tasks."
I have tried moving tasks to the DeployStep node, but it makes no difference. Regardless, the tasks are all located within the DeployPhases node of the export JSON I am building a template from.

Anyone ever successfully build a Release Pipeline with Environments/Tasks, etc., using JSON through the Create Release API? Definitions - Create - REST API (Azure DevOps Release) | Microsoft Learn

0 Replies