azureazure-devopscontinuous-integrationazure-pipelines

How to get all the artifact names in deploy pipeline?


TL;DR: How to get all the artifact names in deploy pipeline?

Hi,

I have multiple branches, and a single generic build pipeline to build their artifacts

artifact name example: TestProject_Feature1Branch_BuildNumber70_Date20240725

I'd like to create a generic deploy pipeline. How can I easily pick which artifact to deploy?

In the deploy pipeline, I could parameterize the artifact name but having to dig into each build artifact to copy & paste, or manually typing in the name seems to be annoying and error-prone. Ideally, I'd like a dropdown with all the artifact names from the build pipeline.

Thank you!


Solution

  • I'd like to create a generic deploy pipeline. How can I easily pick which artifact to deploy?

    Based on your description, I suggest that you can use the Pipeline resource in deploy Pipeline.

    Here is an example:

    resources:
      pipelines:
      - pipeline: MyCIAlias
        project: projectName
        source: PipelineName
    
    steps:
    
    - download: MyCIAlias
    

    When you run the Pipeline, you can click the Resources tab and select the target artifacts in target Pipeline Run.

    For example:

    enter image description here

    Note: By default, it will show the Build Number, branch, date information. You can select the artifacts based on the information. Or you can custom the Build number variable based on the artifact name.

    For more detailed info, you can refer to this doc: Pipelines resource definition