9

If I recall correctly, Azure Devops was set to add a feature to allow release pipelines to be placed into yaml , similar to build pipeline. Is this feature available yet?

Im hoping to get some guidance on the migration of legacy classic release pipeline, to the new format?

UPDATE: It looks like I'm only about 4 months behind. Posted on May 6, 2019

With our new updates, development teams can now leverage the same YAML documents to build multi-stage pipelines-as-code for both Continuous Integration and Continuous Delivery. This was one of the biggest requests from our customers

here are some helpful links for those that are like me : have many classic release pipelines manually created, interested in the new format.

https://azure.microsoft.com/en-us/updates/unified-pipelines/

https://azure.microsoft.com/en-us/blog/accelerating-devops-with-github-and-azure/

Judy007
  • 5,484
  • 4
  • 46
  • 68
  • Did you look at the documentation? It covers this. – Daniel Mann Sep 11 '19 at 00:14
  • I'm taking a look at the documentation now. This is a new feature this year. – Judy007 Sep 11 '19 at 00:35
  • first, thanks for posting this @joey. Second, yeah this is tough to have a question on a topic that is still moving quickly. Heck azure-devops could abandon the yaml approach and go to somethingelse...who knows – BozoJoe Nov 07 '19 at 16:38

3 Answers3

6

For migrating release classic pipelines, Azure DevOps still lacks some more straightforward support.

But there is an external tool, yamlizr, for helping migrate many release pipelines.

In my case I had to hack a bit the tool (see its issues if they are still opened).

The result is not production ready, but is still a good starting point from my viewpoint, and helps a lot.

Frédéric
  • 9,364
  • 3
  • 62
  • 112
5

I've discovered that Microsoft provides some built-in help to migrate a release pipeline from a classic GUI-based Release pipeline to a YAML-based pipeline.

If you edit your classic GUI-based Release pipeline and drill down to a task, there is a link at top right that says View YAML:

Task in a Release pipeline showing the View YAML link

Clicking the link generates the YAML associated with the task. Unfortunately it doesn't include the field values. Instead it uses variables and doesn't specify the values of those variables:

steps:
- task: IISWebAppManagementOnMachineGroup@0
  displayName: 'IIS Web App Manage'
  inputs:
    IISDeploymentType: '$(Parameters.IISDeploymentType)'
    ActionIISWebsite: '$(Parameters.ActionIISWebsite)'
    WebsiteName: '$(Parameters.WebsiteName)'
    WebsitePhysicalPath: '%SystemDrive%\inetpub\wwwroot\AspNetDemo'
    AddBinding: '$(Parameters.AddBinding)'
    Bindings: '$(Parameters.Bindings)'
    ParentWebsiteNameForVD: '$(Parameters.WebsiteName)'
    VirtualPathForVD: '$(Parameters.VirtualPathForApplication)'
    ParentWebsiteNameForApplication: '$(Parameters.WebsiteName)'
    VirtualPathForApplication: '$(Parameters.VirtualPathForApplication)'
    AppPoolName: '$(Parameters.AppPoolName)'

Luckily the task in the GUI has links against most fields, with field-specific help. That help mentions which variable maps to the field value:

Task in a Release pipeline showing the help linked to a field, highlighting the variable that maps to the field

So you can go through each field in the task determining which variable corresponds to each field, to work out what values to add to the YAML snippet.

It's a bit labour intensive but it's quicker than trying to figure it all out from scratch.

Unfortunately there doesn't seem to be any way to view the YAML at the job or stage level, only at the task level. So you'll have to repeat the process for each task. You'll also have to work out the YAML that defines the stage and the jobs yourself.

Simon Elms
  • 17,832
  • 21
  • 87
  • 103
  • Microsoft documentations are not clear on this. I read somewhere that you can view the YAML at the Agent level, but I could not find that option. Microsoft rabbit holes. Referenced docs: https://learn.microsoft.com/en-us/azure/devops/pipelines/migrate/from-classic-pipelines?view=azure-devops https://devblogs.microsoft.com/premier-developer/converting-classic-azure-devops-pipelines-to-yaml/ – SijuMathew Feb 23 '21 at 09:49
1

Create a new multi-stage pipeline-as-code. https://azure.microsoft.com/en-us/updates/unified-pipelines/

https://azure.microsoft.com/en-us/blog/accelerating-devops-with-github-and-azure/

Judy007
  • 5,484
  • 4
  • 46
  • 68
  • Thanks for sharing your solution here, you could Accept it as an Answer, so it could help other community members who get the same issues and we could archive this thread, thanks. – Hugh Lin Sep 19 '19 at 11:41