Azure DevOps API - Problem Using Patch Method on Build Definition

Nguyen, Andrew 1 Reputation point
2020-06-26T17:09:42.39+00:00

Hey,

I am trying to create a script to automatically update the branch of a set of build definitions but currently testing it out with Postman with the API.

I tried changing the branch variable on an existing build instance and that worked just fine but when I tried to change it on a build definition since we want to run a new build with the changed branch, I am getting

{
"count": 1,
"value": {
"Message": "The requested resource does not support http method 'PATCH'."
}
}

Does the build definition not have anyway to update the data thru API?

I am calling to https://dev.azure.com/{organization}/{project}/_apis/build/definitions/{idName}?api-version=5.1

On the documentation for updating Definition (https://learn.microsoft.com/en-us/rest/api/azure/devops/build/definitions/update?view=azure-devops-rest-5.1)

The example here is using PUT but that seem like it'll have a bigger room of error needing to overwrite the whole configuration.

Any help would be much appreciated. Thanks!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,960 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-06-26T19:09:27.347+00:00

    Just a heads up, they're actively answering Devops questions in dedicated forums here.
    https://developercommunity.visualstudio.com/spaces/21/index.html

    --please don't forget to Accept as answer if the reply is helpful--


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.