1

How to create Agent Pool in Azure DevOps via C# client?

I find some raw rest api for agent pool like this documentation.

But I want to create agent pool via C# client.

Now I use Microsoft.TeamFoundationServer.ExtendedClient library, but can not find the solution.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Admiral Land
  • 2,304
  • 7
  • 43
  • 81

1 Answers1

2

You need also the Microsoft.TeamFoundation.DistributedTask.WebApi nuget package:

VssConnection connection = new VssConnection(new Uri("URL"), new VssCredentials());
var client = connection.GetClient<TaskAgentHttpClient>();
client.AddAgentPoolAsync(new TaskAgentPool("TestPool"));
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114