105

I am following this process to create a YAML build pipeline for a .NET Core Web API project:

https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started-yaml?view=vsts

When it comes to releasing it, I note that the (recently renamed) Azure DevOps doesn't seem to support YAML for defining release pipelines. However, I can see that deployment tasks have been defined eg:

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment?view=vsts

Are we expecting an upgrade to the release pipelines functionality to support YAML and, if so, when?

riQQ
  • 9,878
  • 7
  • 49
  • 66
Michael12345
  • 2,520
  • 5
  • 23
  • 41
  • 3
    Soon, at Build 2019: https://www.youtube.com/watch?v=ORy3OeqLZlE Multi-stage pipelines (and Release YAML) is now in preview. Enable it in the Preview Features menu item. – nullforce May 06 '19 at 23:22
  • 4
    Could someone help me in understanding why this question is off-topic? For me it seems like good question for stackoverflow. – Tobske Jun 26 '20 at 09:14
  • 1
    Because it's a "when is this feature coming?" question, not a programming question that others can help to solve. – james.garriss Oct 27 '22 at 14:23

5 Answers5

69

At the time of writing this response the features timeline reflects yaml releases are coming 2018 Q3.

https://learn.microsoft.com/en-us/azure/devops/release-notes/

Update: This has been bumped a few times. Checking the comments below is recommended as folks have been providing updates as they find them.

Update

As per comments, this is now possible: https://devblogs.microsoft.com/devops/whats-new-with-azure-pipelines/. The following is copied and pasted from the article and demonstrates using various stages:

stages:
- stage: Build
  jobs:
  - job: Build
    pool:
      vmImage: 'Ubuntu-16.04'
    continueOnError: true
    steps:
    - script: echo my first build job
- stage: Deploy
  jobs:
    # track deployments on the environment
  - deployment: DeployWeb
    pool:
      vmImage: 'Ubuntu-16.04'
    # creates an environment if it doesn’t exist
    environment: 'smarthotel-dev'
    strategy:
      # default deployment strategy
      runOnce:
        deploy:
          steps:
          - script: echo my first deployment
Chris Pfohl
  • 18,220
  • 9
  • 68
  • 111
JDH
  • 2,618
  • 5
  • 38
  • 48
  • 11
    Now it is in the 2018 Q4 Features. – sschoof Oct 23 '18 at 15:27
  • 6
    There is a workitem to track this https://dev.azure.com/mseng/Azure%20DevOps%20Roadmap/_workitems/edit/1221170 – sschoof Nov 01 '18 at 07:18
  • 1
    It is already available: [GitHub Release task](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/github-release). – kittaakos Dec 12 '18 at 10:18
  • 3
    That implies your code is in a github repository which may not be the case. – JDH Dec 12 '18 at 18:11
  • 1
    The work item now says "Cut". Not sure what that means. And also contains a link to a duplicate item https://dev.azure.com/mseng/Azure%20DevOps%20Roadmap/_workitems/edit/1364226. I'm not sure where the community is supposed to interact with the azure devops team on these work items. – DannyMeister Jan 22 '19 at 21:20
  • Was @DannyMeister or anyone else able to find out more information? This seems like a vital feature. – Oren Hizkiya Jan 24 '19 at 18:07
  • 8
    I reached out via twitter yesterday. YAML release definitions are being worked on at the minute with the aim of it going into private preview by the end of March. Full thread at https://twitter.com/gopinach/status/1088320931745935360?s=21 – rh072005 Jan 24 '19 at 20:58
  • 2
    The roadmap item for this is called "Multi-stage pipelines" and will include release pipeline YAML support. https://dev.azure.com/mseng/AzureDevOpsRoadmap/_workitems/edit/1364226/ – Brent Robinson Mar 07 '19 at 04:36
  • 7
    Latest work item tracking this - https://dev.azure.com/mseng/AzureDevOpsRoadmap/_workitems/edit/1364226 – antmeehan Mar 11 '19 at 07:08
  • 13
    finally! https://devblogs.microsoft.com/devops/whats-new-with-azure-pipelines/ May 7th 2019 – Kat Lim Ruiz May 15 '19 at 21:33
  • It appears to me that "Releases" is going to be deprecated in favour of deploying from a pipeline? – Jules Clements Aug 30 '19 at 02:14
  • Can you provide a reference to the announcement that Releases will be deprecated in favor of azure pipeline? I actually read this: https://devblogs.microsoft.com/devops/whats-new-with-azure-pipelines/#comment-330 – diegosasw Nov 08 '19 at 15:44
  • 4
    There are still many features missing when going full YAML for builds and releases. They are nowhere near feature parity. What about rerunning a release (not the build!)? What about skipping one release and jumping straight to another environment? These are all typical things done with the GUI/day-to-day that are missing with the switch to YAML. It's decent for builds, but I'm not convinced of the time save. Builds don't change all that often and you can set them up via the GUI in less time than it takes to look up the YAML syntax for each task. – jrap Feb 12 '20 at 15:55
7

The Product Team is working on it. You can track the update through Release notes.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • 1
    "The Product Team" hasn't done anything after 1 year. Azure Dev Ops UI is still horrible and the yaml support for Deployment and still isn't there despite all the empty promises. The documentation is non-existent and is scattered throughout the net, Azure Dev Ops is a mightmare to use! Microsoft should find something else to do, – ATL_DEV Nov 18 '19 at 02:51
  • Just for the sake of technical accuracy - despite that comment being posted in November, 2019 saying that YAML support for deployment "still isn't there," it was actually added to Azure DevOps (no space) in May, 2019. Other answers and comments get more into this. Just wanted to make sure someone reading this get the wrong idea. – MikeBaz - MSFT Apr 01 '20 at 14:10
7

YAML build pipeline creation experience is in preview. (today is 2018-12-04)

YAML for release pipelines seems to be a ways off still: 2019 Q2

Preview features can be enabled from your profile like this:

profile menu

YAML feature

EDIT: As nullforce points out in comments, this only enables a YAML experience for build pipelines and not release pipelines.

UPDATE (2019-05-16): Following Microsoft's "Build 2019", the full YAML experience for both build and deployment should now be possible in the same YAML pipelines file.

Jim Wolff
  • 5,052
  • 5
  • 34
  • 44
  • 6
    This question is asking about Release pipelines, not Build pipelines. The preview feature you indicated only turns on the Build pipeline YAML. – nullforce Dec 07 '18 at 14:18
  • @nullforce Thank you, i have added your correction to my answer, and will try to keep it up-to-date if this is enabled for release pipelines or when yaml comes out of preview aswell. – Jim Wolff Dec 08 '18 at 20:40
  • 1
    It's still not available. – ATL_DEV Nov 17 '19 at 00:29
  • @ATL_DEV could you elaborate on a state, or link to resources regarding this, so i can correct the answer. To me it looks like it's available: [docs](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema) – Jim Wolff Nov 17 '19 at 23:57
  • @Jim Wolff-- Microsoft are liars! The release and deployment parts can only be configured via its crappy UI only. – ATL_DEV Nov 18 '19 at 00:58
  • @Jim Wolff--I asked a similar question recently and it clarifies my findings:https://stackoverflow.com/questions/58896408/how-do-i-edit-view-and-edit-the-yaml-file-for-the-release-pipeline-in-azure-dev/58898792#58898792 – ATL_DEV Nov 18 '19 at 12:41
5

I am in the middle of doing something like this right this very moment, but I am using the current REST APIs. What I am doing something similar to what I documented here (How do you import a release definition in VSTS?). Basically I am saving a templated JSON Release Pipeline file into the source code repository with variable placeholders, and a version number embedded. A then have a PowerShell script that is calling the Azure DevOps (that's a long word, I preferred typing VSTS, maybe I'll start typing AD)

  • REST APIs to check of the Release Pipeline exists - works
  • Create if it doesn't exist - works
  • Compare embedded versions and update and if necessary (I'm stuck here, but I'll solve it, returning error that pipeline being updated hasn't changed even though I've changed it.)

I want this to executing during the Build pipeline so that I no longer have to modify lots of similar Release pipelines manually. I would prefer this to be a YAML file as well, but this is what I have today. I hope this helps.

Antebios
  • 1,681
  • 1
  • 13
  • 22
  • 1
    I'm stuck and have halted my work effort on the UPDATE process. Why? The Release Definition json template has an ID for each build step. The IDs have to be a specific number when the Release Pipeline is being created. The ID number is changed after it is created. So, when you UPDATE the Release Pipeline you can no longer use the "new" Stage ID numbers (they are reserved when initially creating a Release Pipeline), but instead you need to use the now valid Staged ID that could be anything. – Antebios Oct 24 '18 at 15:11
  • So the actual process should be: For create process use template. For update process download release definition and compare to template and update downloaded release definition and then update that one back to VSTS. Whew! That means I need to write my own comparison process and error checking. – Antebios Oct 24 '18 at 15:11
  • in fact, for a new release definition (POST), you can ignore the `id` property - `id` for the release def object and in all `environment` objects can be ignored - setting the `rank` property should suffice (along with other required ones) - the POST call should automatically create the IDs and return in the response object. Once release definition is created, to get all definitions in your org you can do a `LIST` on release definitions - GET call is documented [here](https://learn.microsoft.com/en-us/rest/api/azure/devops/release/definitions/list?view=azure-devops-rest-5.0) – obfuscate Jan 15 '19 at 17:07
-8

Pipelines are made of one or more jobs and may include resources and variables. Jobs are made of one or more steps plus some job-specific data. Steps can be tasks, scripts, or references to external templates. This is reflected in the structure of the YAML file. Please visit here for details

Zoe
  • 27,060
  • 21
  • 118
  • 148