0
votes

I have a Deployment Group with X number of servers.
I've created and set up my Release Pipeline to work as expected.
When I run it, it deploys to all servers under my Deployment group. (I do filter by specific Tags but that's irrelevant)

What I need now, is to be able to filter/exclude servers on the fly during deployments (for example: deploy only on the first server and leave the rest unchanged)

Something like the below (screenshot taken from Octopus which supports this functionality) enter image description here

I'm trying to migrate a few Release Definitions from Octopus to Azure Pipelines and this is blocking me.

2
It looks like this is not supported so I created a ticket at developercommunity.visualstudio.com/idea/938778/…George Vovos

2 Answers

2
votes

Since this is not supported by Azure Pipelines, I ended up using a workaround:

  1. Create a Pipeline Variable that contains my 4 server names. enter image description here

  2. Add a Custom condition on my steps
    'and(succeeded(), contains(variables['IncludedServers'],variables['Agent.MachineName'])) enter image description here

3.Edit the variable, if necessary, when creating a release enter image description here

I do want to improve a few things, like the contains expression so that there are no problems with false positives when I have substrings.

It's not perfect, because of the possibilities of typos but it's probably an acceptable workaround. Hopefully Microsoft will add official support for this.

I'm adding the feature request link again here, upvote if you find this useful.
Allow users to Exclude Deployment Targets from Release on the fly

1
votes

How deploy Release on subset of Deployment Group servers

Generally, we use machine tags to limit deployment to specific sets of target servers.

The tags you assign allow you to limit deployment to specific servers when the deployment group is used in a Deployment group job.

enter image description here

enter image description here

In addition, you can also disable targets in the Deployment pools of Organization Settings.

enter image description here

Update:

Here is the uservoice on allowing users to Exclude Deployment Targets from Release on the fly. Anyone interested in this can vote for it and track it.