Search code examples
c#azure-devopsazure-devops-rest-apitfs-sdk

Can I Add/Update/Delete policy configurations using the .NET SDK?


I know that there is a REST API for these operations

On the GitHttpClient class though, I can only find a method that GETs policy configurations (GetPolicyConfigurationsAsync)

Is there anything on the SDK that allows Add/Update/Delete or I'll have to create and make the http request myself?

I'm using Nuget package Microsoft.TeamFoundationServer.Client.16.153.0

Thanks


Solution

  • Can I Add/Update/Delete policy configurations using the .NET SDK?

    To achieve these action, please check the PolicyHttpClient class.

    UpdatePolicyConfigurationAsync: this method can for you make some updates into policy configuration.

    DeletePolicyConfigurationAsync: Delete the policy configuration.

    For Add, I think this could be also achieved with the UpdatePolicyConfigurationAsync method.