user3647324
user3647324

Reputation: 113

Azure DevOps API - how to reference other pipeline as resource parameter

I have an Azure DevOps pipeline and want to reference other pipeline that my pipeline will fetch the artefacts from. I am struggling to find a way to actually do it over REST API. https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run%20pipeline?view=azure-devops-rest-6.1 specifies there is a BuildResourceParameters or PipelineResourceParameters but I cannot find a way to get it to work.

For example: Source pipeline A produces an artefact B in run C. I want to tell API to reference the artefact B from run C of pipeline A rather than refer to the latest.

Anyone?

Upvotes: 0

Views: 493

Answers (1)

Felix
Felix

Reputation: 1152

In your current situation, we recommend you can follow the below request body to help you select your reference pipeline version.

{
    "stagesToSkip": [],
    "resources": {
        "repositories": {
            "self": {
                "refName": "refs/heads/master"
            }
        },
        "pipelines": {
            "myresourcevars": {
                "version": "1313"
            }
        }
    },
    "variables": {}
}

Note: The name 'myresourcevars' is the pipeline name you defined in your yaml file: enter image description here

Upvotes: 1

Related Questions