How to create new build pipeline using Azure DevOps REST API?

How to create new build pipeline using Azure DevOps REST API? To create the new build pipeline, we could use the REST API Definitions – Create: POST https://dev.azure.com/{organization}/{project}/_apis/build/definitions?api-version=5.0 But we need provide too much information in the Request Body, this will be a big project and error-prone. That also the reason why the document not … Read more

Fatal: Could not read password for ‘https://[email protected]’: terminal prompts disabled

As you mentioned you need to use PAT but in this way: git push https://{PAT}@dev.azure.com/{organization}/{project}/_git/{repo-name} Another solution is to “Allow scripts to access the OAuth token” in the job options: In the git push use the System.AccessToken: git push https://$env:[email protected]/…… And give push permissions to the build user (in the repo settings):

Share variables across stages in Azure DevOps Pipelines

Updated: Share variables across stages feature has been released in Sprint 168 now. Please use below format to access output variables from previous stage: stageDependencies.{stageName}.{jobName}.outputs[‘{stepName}.{variableName}’] Original: Share variables across stages in Azure DevOps Pipelines I’m afraid to say that it does not supported to share the variable which defined in one stage and pass it … Read more

Is it possible to conditionally set the artifact name in my Azure DevOps build pipeline “publish artifact” task?

Is it possible to conditionally set the artifact name in my Azure DevOps build pipeline “publish artifact” task? I am afraid there is no such out of box way to do that. If you want to conditionally set the artifact name, we have to use the nested variables in the pipeline. However, At this moment, … Read more

Copy one file in target directory on deploy from visual studio team services

You need to specify the copy root if you want to copy files only without folder structure. Since the project.exe is in a different path with script.ps1 file, you need to copy them in different copy task. Following the steps below: Add a “Copy Files” step to copy “project.exe”. Settings like following: Add a “Copy … Read more

Triggering Azure DevOps builds based on changes to sub folders

You can do like below Create variables based on your microservices with the values “False” E.g,MicroserviceAUpdated= “False”,MicroserviceBUpdated= “False” etc., Add a Powershell script task at the begin of your build definition. The powershell script will do the following: Get the changeset/commit in the build to check which files are changed. Update the MicroserviceAUpdated variable to … Read more