Cataster
Cataster

Reputation: 3541

Is it possible to rename a release?

Can we rename a release in Azure Devops (Not Release Pipeline)?

enter image description here

I'm not looking to edit the Release name format property in the General page. I want to rename the release once it's already created/forked from the release pipeline.

Upvotes: 3

Views: 1654

Answers (2)

trnelson
trnelson

Reputation: 2773

Here's an updated answer: You can rename a release, however in my experience this can only be done from within the release itself as a task within one of your Stages. I do this as a separate Stage, prior to my environment releases:

Set Release Name -> Deploy DEV -> Deploy TEST -> Deploy PROD

Here's how:

From the Release Pipeline edit page, add a new Stage with a name like "Set Release Name". I set this as my first Stage, which is automatically triggered, and is a required step before my DEV environment deployment Stage (if it fails for some reason, I don't want to continue).

Within this Stage, add a Powershell task, and for the type, select Inline.

In the inline script box, you'll set the pipeline variable for release.updatereleasename like the example below--note you can use variables as needed, like $Version, and in this example I've also appended the original release number by using the $(Release.ReleaseId) variable.

$ReleaseName = "MyApp $Version"
Write-Host "##vso[release.updatereleasename]$ReleaseName - Release $(Release.ReleaseId)"

When that script task executes the release will be renamed to something like:

MyApp 1.2.0 - Release 126

It may be possible to execute this as a parallel task (automatically triggered but not required before any environment release stages) but I haven't tried this yet. Hope this helps!

Upvotes: 2

Ole Pannier
Ole Pannier

Reputation: 3683

The simply answer is, you can't perform a rename operation at a pipeline level. If you want to change it in the Azure portal you can Clone the pipeline from the Author and Deploy blade. Then deploy the pipeline again with the new name and drop the old version.

This documentation also say that if a pipeline is created it creates unique artefacts that can't be renamed. So as mentioned, copy it and make a new one with your new name.

Upvotes: 1

Related Questions