Open PatrickGrub opened 4 years ago
You'll need to install Microsoft.TeamFoundation.DistributedTask.WebApi
nuget package,
reference Microsoft.TeamFoundation.DistributedTask.WebApi
then you can initialise TaskAgentHttpClient
var devopsConnection = new VssConnection(new Uri(devopsUrl), new VssBasicCredential(string.Empty, devopsToken));
var taskClient = devopsConnection.GetClient<TaskAgentHttpClient>();
var variableGroups = taskClient.GetVariableGroupsAsync(project.Id).Result;
then use methods on these to modify as you desire.
Not impersonating didn't know.
I want to change via C# in Azure Devops in a specific Variable Group a specific variable: https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/variablegroups?view=azure-devops-rest-5.0
How can I get started? Which
VssHttpClientBase
do I need? Examples?