0
votes

I want to create a parameter in YAML deploy pipeline to let user mention the build id they want to pass for deployment while running manually.

How can I use that specific build id passed as parameter during deployment inside deployment pipeline?

Deployment pipeline resource definition is:

resources:
  pipelines:
  - pipeline: build 
    source: build_pipeline_name 
    trigger:
      branches:
      - master

Choosing from Resources is not an option due to access restriction on the Environments we are using in pipeline.

1

1 Answers

0
votes

If you want to download just specific artifact you won't be able to do this usisng just resource, as you cannot parameterize resources. However, if this is your goal you can parameterize this task:

parameters:
- name: runId
  type: number

# Download an artifact named 'WebApp' from a specific build run to 'bin' in $(Build.SourcesDirectory)
steps:
- task: DownloadPipelineArtifact@2
  inputs:
    source: 'specific'
    artifact: 'WebApp'
    path: $(Build.SourcesDirectory)/bin
    project: 'FabrikamFiber'
    pipeline: 12
    runVersion: 'specific'
    runId: ${{ parameters.runId }}


However, I'm not sure if I understood you.