Search code examples
powershelldeploymenttfsrelease-managementms-release-management

Programmatically trigger a Release independently from a build


I currently use Team Foundation Server 2013 Update 3 and Release Management 2013 with Update 3.

With Release Management one can start a Release manually or automatically from a build ("Can trigger a Release from a Build" option).

Is it possible to trigger a Release programmatically and independently from a build? In practice, is there a way to interact with Release Management (presumably with its server component) through a service or a command line tool (e.g. like the TFS Power Tools)?

Ideally I'd like to do that using PowerShell, so I was wondering what options I have to accomplish that.


Solution

  • You have a few options, depending on whether you're using vNext release templates or agent-based release templates.

    • If you're using vNext release templates: There is a poorly-documented REST API available in Update 3 and Update 4.

    • If you are using agent-based templates, you can use ReleaseManagementBuild.exe, which is in the client's bin folder (usually in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\Client\bin). You must run and configure the client, ReleaseManagementConsole.exe, prior to using ReleaseManagementBuild.exe.