We have just migrated our code from on-site TFS to Azure DevOps.
With TFS, I use a powershell script to build and deploy the application. The deployment part still works fine, but I don't know how to trigger the build. The command line I used with the old TFS is:
& "F:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\TFSBuild" start [repository URL] [project] "[build definition]"
I know that DevOps has a REST API https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-5.0 but there are many options and no examples there. I also saw this post: How to QUEUE a new build using VSTS REST API but the solution there does not wait for the build to finish and it uses API 4.1 - not sure if it's valid for DevOps? I already configured the build definitions in DevOps.
The URL to where the build is configured in DevOps is of this format:
All I need is to queue a build from a powershell script and wait for the build to complete, i.e. equivalent of my TFSBuild script above. Can someone help please?