Azure DevOps API - Create a pipeline from a YAML file located in a specific branch source

0 votes

I used this JSON to create my pipeline :

$pipelineJSON = @{

    configuration = @{

        variables = @{

            example = @{

                value = "to be defined"

            }

        }

        path = "azure-pipelines.yml"

        repository = @{

            id = "myRepoId"

            name = "myRepoName"

            type = "azureReposGit"

        }

        type = "yaml"

    }

    name = "pipeline-test"

    folder= "\\"

} | ConvertTo-Json

$request = 'https://dev.azure.com/' + $organization + '/' + $projectName + '/_apis/pipelines?api-version=6.0-preview.1'

$responseCreatePipeline = Invoke-RestMethod $request -Method 'POST' -Headers $headers -Body $pipelineJSON -ContentType "application/json"

 I want to create this pipeline from a YAML file located in a different branch. Does anyone know how to do it?

Apr 14 in Other DevOps Questions by Kichu
• 19,040 points
423 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

0 votes
1 answer

Is it possible to have a link to raw content of file in Azure DevOps

Sure, here's the call for the rests: GET ...READ MORE

answered Feb 10 in Other DevOps Questions by Bhavitha
• 1,000 points
144 views
0 votes
0 answers
0 votes
0 answers
0 votes
0 answers

How to create a feature burndown chart in Azure DevOps?

The Azure DevOps documentation that describes Burndown and ...READ MORE

Mar 26 in Other DevOps Questions by Kichu
• 19,040 points
658 views
–1 vote
0 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP