Reputation: 98
I'm new to Azure DevOps REST API (and somewhat to REST in general) and have been asked to create a PowerShell script to create basic build pipelines. I've found that the documentation provided by Microsoft does not include a single example for creating build definitions, nor does it even provide a template for the JSON request body. I've read through all of the articles on Stack Overflow related to the topic that I can find, but none of them seem to provide a real answer to this issue.
If anyone could provide an example of the required request body, or a link to one, I can put the rest of it together.
Thanks.
Upvotes: 2
Views: 1321
Reputation: 44046
The documentation at https://learn.microsoft.com/en-us/rest/api/azure/devops/build/definitions/create?view=azure-devops-rest-5.0 does a pretty good job of explaining how to communicate with Azure DevOps to create a new build definition. The request body section of the documentation lists all the parameters you'd put into a REST call.
I would hazard that this feels like an odd question because it is unusual to create build definitions programmatically. You might want to check your assumptions and see if this is really what you want to do.
Upvotes: 1