I'm currently creating a release definition for our project and I'm stuck with this problem, could both build and release definition use the same agent if yes, then how? If no, what are other options to do this?

I've already posted the same question on github and Microsoft developer community. Here are the links:

Microsoft Dev:

https://developercommunity.visualstudio.com/content/problem/108045/could-both-build-and-release-definition-use-the-sa.html#

Github:

https://github.com/Microsoft/vsts-agent/issues/1193

2

There are 2 best solutions below

11
On BEST ANSWER

Yes.

Set agent for release:

enter image description here

Set default agent for build (You can change agent when queue build)

enter image description here

An article about setup a private agent: Deploy an agent on Windows

1
On

Yes, both your build and release definitions can use the same set of agents ( which are called Agent Queues in VSTS )

For eg. - You can configure an agent in the "Default" agent queue in VSTS and configure both your build and release definitions to use "Default" queue. This will allow you to run both builds and releases but a single agent can only run any one of them at one point of time

https://www.visualstudio.com/en-us/docs/build/concepts/agents/pools-queues