Search code examples
azureazure-devopsazure-cloud-services

How to run agent job in Azure DevOps on artifact conditions


I have set two artifacts in one release pipeline and created one stage with two-agent jobs, Also I have set continuous deployment triggered enabled for both artifacts(have separate CI pipeline).

But I have to set a condition on the basis of artifacts for both agent job if release triggered by one artifact run only the first agent job which is on stage1 and if triggered by the second artifact then run the second agent job which on stage1

enter image description here

enter image description here


Solution

  • To achieve this you need to define condition like this:

    eq(variables['Release.TriggeringArtifact.Alias'], 'first')

    enter image description here

    enter image description here