question

SALISFrancesco-4152 avatar image
0 Votes"
SALISFrancesco-4152 asked MayankBargali-MSFT edited

Create link to Source Code Commit in an Azure Pipeline downloading related artifact

Hello,

I have a pipeline which

  • is triggered manually

  • downloads the build artifacts of 3 other pipelines, all of them based on different (git) repositories

  • allows the user to input the BuildId (Run number) of these pipeline-artifacts, to choose which runs to take them from

  • creates a package with them

  • is written in YAML

I'm looking for a way to show in the "Resources" tab the Source code link for the commit relative to each of pipeline builds, which artifacts have been downloaded during this run.
To do this, I have to name each of the repositories and checkout the proper version.

What I can't get my head around is how to exploit the BuildId variable to get the SourceVersion variable.

I know that Build.BuildId variable is the one defining the run id of the pipeline, an we use this to choose which run to take the specific artifact from.
At the same time, Build.SourceVersion contains the commit Id used for the pipeline run. But normally, Build is the current Build.

How can I reference Build_x, starting from Build_x.BuildId, so to be able to recover the Build_x.SourceVersion?

Thank you

not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered

Hi @SALISFrancesco-4152

Welcome to Microsoft Q&A! Thanks for posting the question.

DevOps is currently not supported in the Q&A forums, the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

You can ask the experts in the dedicated forum over here:
https://stackoverflow.com/questions/tagged/devops
https://developercommunity.visualstudio.com/spaces/21/index.html

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.