How do i identify my AzureDevOps id for a pipeline in ADO Pipelines?

冷暖自知 提交于 2020-12-11 09:13:31

问题


So I am attempting to create a downstream project trying to use an artifact stored in azure pipeline artifact to build. I am using the task DownloadPipelineArtifact@0

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops

It talks about the need for a pipelineId, not really sure where to find out the id for my other pipeline. Is there any easy way, its supposed to be a ~4 digit number according the documentation.

Thanks


回答1:


There is an existing open issues on the pipeline ID.

The doc which you mentioned doesn't provide much information about pipelineID.

As per microsoft

pipelineId appears to be BuildId, and not the build definition id. It needs the actual instance id of where the artifact is associated. I was able to make this work by referencing a release variable tied to the artifact alias. My alias is named "artifacts" and using $(RELEASE_ARTIFACTS_ARTIFACTS_BUILDID) did the trick. So the format would be $(RELEASE_ARTIFACTS_<alias>_BUILDID)

If you were trying to consume in a build and not a release pipeline you would need to somehow get the value of $(Build.BuildId)

I hope as this matures there are plans to make pipeline artifacts published from a build automatically in release, just like they are when using the old Build Artifacts. Currently for me that is not happening so I am forced to manually add this step to my release pipeline and associate it with the build pipeline.



来源:https://stackoverflow.com/questions/54563230/how-do-i-identify-my-azuredevops-id-for-a-pipeline-in-ado-pipelines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!