问题
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 beBuildId
, 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