Bartosz
Bartosz

Reputation: 4766

Get name of an artifact in Azure Release Pipelines Task Group

I am working on a release pipeline which consumes an internally published nuget package.

I will have multiple release pipelines which will do the same thing (triggered by various build pipelines), so I want to reuse the steps of the release within a task group.

One of the steps of the task group is Download Package and as a parameter it expects the package name. I don't want to provide the PackageName as a task group parameter, because that's an extra magic string to be configured.

Since there is always only one artifact, which triggers the release, I would like to get its name and pass it to the task setting.

I don't see any way to do that, it doesn't seem there's a built in variable for this - closest I get is RELEASE_PRIMARYARTIFACTSOURCEALIAS.

Is there any way to achieve that, perhaps with a script?

Upvotes: 0

Views: 718

Answers (1)

Edward Han-MSFT
Edward Han-MSFT

Reputation: 3185

If your release pipeline is triggered by build pipeline, so it will take the corresponding build artifact as source artifact, and then there will be a default step Download Artifacts to download artifact.

Therefore, it is not needed to download this package again in your task group in release pipeline. See: Artifact download for more details.

Upvotes: 1

Related Questions