user799755
user799755

Reputation:

Cloning an Azure Devops yaml Pipeline

Azure Devops pipelines provide a clone functionality. This is super useful functionality for scaffolding pipelines. My yaml pipelines have a lot of variables, and it's difficult and error prone to reassign all of these variables from scratch.

The Azure Devops UI updated in the last week or so, and there doesn't seem to be an option to clone yaml pipelines anymore. Classic pipelines still have the clone option.

Can anyone figure out how to clone a yaml pipeline with the new UI?

Upvotes: 1

Views: 1997

Answers (3)

Boologne
Boologne

Reputation: 195

I've never used a cloning option in YAML. But I wouldn't use so many Azure DevOps variables which were created in the UI. You have multiple options here:

  • Store the variables in your YAML file (not for secrets)
  • Store the variables in a YAML template (not for secrets)
  • Store the variables in a variable group (use Azure Key Vault or the Secure flag for secrets)

The variable group can be linked to multiple pipelines. But there is currently no scope available. So, if you have multiple environments, you have to name it like "myvariablegroup-dev", "myvariablegroup-prod". Hopefully, this feature to attach a variable group to an environment is coming in the near feature.

Upvotes: -1

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30313

1,You can disable the multi-stage pipelines feature in preview features

On the top right corner of the page click the user profile and choose Preview features

enter image description here

Then disable the Multi-stage pipelines. Then you will see the clone option appear again.

enter image description here

2,The other workaround is to create a new pipeline and choose to use the Existing Azure PipelineS Yaml file while following the wizard. (which has the same effect with cloning yaml, they use the same azure-pipelines.yml file)

enter image description here

Then choose the same yaml file with the original pipeline. enter image description here

Upvotes: -1

Josh Johanning
Josh Johanning

Reputation: 1235

Hmm I haven't used the clone feature, but have you investigated using variable groups or variable templates to make your life easier? You can link a variable group to Azure Key Vault to facilitate secrets.

Upvotes: 0

Related Questions