Search code examples
azureazure-pipelinesdevopsazure-artifacts

Is it possible to forward an azure artifact from one pipeline to another?


I'm doing a project where I want a intermediate pipeline to consume an artifact from another pipeline to later forward it to another pipeline, which then starts running. I have not managed to find a solution online to this functionality and I'm starting to think that that functionality is not (as of today) supported in Azure DevOps. Can someone confirm whether this implementation is possible with pipelines? If not, how should one approach this scenario? I'm relatively new to Azure DevOps, so it's possible that I might have missed or misunderstood some information online.

I know that a pipeline can download an artifact which was published by another pipeline. And I know about pipeline triggers. Currently I have managed to consume artifacts in the intermediate pipeline, but now I have to find a way to send those artifacts to a specific pipeline, from the intermediate pipeline.

I appreciate all the help I can get.


Solution

  • but now I have to find a way to send those artifacts to a specific pipeline, from the intermediate pipeline.

    We could publish build artifact from the intermediate pipeline by the Publish Build Artifacts or Publish Pipeline Artifacts task in the intermediate pipeline, then we use the Download Build Artifacts or Download Pipeline Artifacts task in the specific pipeline to download the artifact which we published from intermediate pipeline.

    Yo could check this document Publish and download artifacts in Azure Pipelines for some more details.

    Update:

    Are you aware if this functionality is planned for Azure DevOps? If we put it this way - is it possible for my intermediate pipeline to, depending on some variables, trigger a specific pipeline (i.e. it can trigger two different pipelines, but which one to trigger depends on some variables)?

    The answer is yes. There is extension Trigger Build Task, which can be used to trigger a new Build so that build-chaining is possible.

    And we just need add the value of the variables as condition for this task, then we could trigger a specific pipeline depending on some variables.

    Where this specific pipeline is in another project. Is it also possible for this pipeline to access the variables which I created in my intermediate pipeline?

    I think I might understand what you want to achieve. you want to create some variables in the intermediate pipeline, then use this variables in the specific pipeline.

    The answer is yes. But there is no directly way to access the variables which you created in intermediate pipeline. The solution we need to set the default value for the variables in the specific pipeline, then use REST API Definitions - Update to update those variables in the intermediate pipeline.

    Please check my previous thread for detailed REST API scripts.