I've noticed the existance of a PublishPipelineArtifact task but it is not clear to me if there is any functional difference from the older PublishBuildArtifacts task?
Build artifacts: Build artifacts are the files that you want your build to produce. Build artifacts can be nearly anything that your team needs to test or deploy your app. For example, you've got .dll and .exe executable files and a .PDB symbols file of a .NET or C++ Windows app.
Pipeline artifacts: You can use pipeline artifacts to help store build outputs and move intermediate files between jobs in your pipeline. Pipeline artifacts are tied to the pipeline that they're created in. You can use them within the pipeline and download them from the build, as long as the build is retained. Pipeline artifacts are the new generation of build artifacts. They take advantage of existing services to dramatically reduce the time it takes to store outputs in your pipelines. Only available in Azure DevOps Services.
Here is an issue about it on GitHub and Microsoft answered:
Build Artifacts (published via the
Publish Build Artifacts
task) have been in Azure DevOps for a long time and are the built-in artifact storage mechanism for Azure Pipelines. Most builds that store non-package artifacts today would likely use this task. The task can push the content up to the server/cloud but can also copy the files to a local file share.Pipeline Artifacts (published using the
Publish Pipeline Artifact
task are intended as the replacement for Build Artifacts). The benefit of Pipeline Artifacts is that they can dramatically reduce the time it takes to upload and download large artifacts. We do this be first checking whether the content that is being uploaded exists in the service. We do this not just at the per-file level but also at the sub-file level (in up to 128K chunks). It can lead to really dramatic performance improvements.
In addition, here is a ticket with the same issue you can refer to.