What is the difference between Build Artifact and Pipeline Artifact tasks? - azure-devops

In Azure DevOps, we have Download/Publish Build Artifact tasks and Download/Publish Pipeline Artifact tasks.
What is the difference between the build artifact tasks and the pipeline artifact tasks and when would we choose one over the other?

There is an issue about it in Azure DevOps GitHub and Microsoft answered:
Hey everyone - I'm from the Azure Artifacts team and we built the
Pipeline Artifacts feature that you've discovered in Azure Pipelines.
I'll address the most important comment around documentation - we've
got a whole new page coming out around Artifacts in Azure Pipelines
which lists out each artifact type that we support and what they are
for along with links to specific documentation. We think that should
answer most of your questions.
Because that is still being edited before we publish it I thought I
would give you the 30,000 foot view on the difference between Pipeline
Artifacts and Build Artifacts and also mention how Pipeline Artifacts
relate to Universal Packages.
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. They are in
preview right now and there are a few more things we need to do to
reach parity. 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.
Universal Packages - also in preview use the same storage/transfer
technology as Pipeline Artifacts. You would use Universal Packages
when you want to create an artifact with a life time independent of
the pipeline that created it. You can download Pipeline Artifacts
after a pipeline has completed via the artifacts UX - but if you want
something that really exists independent of pipeline you would go for
Universal Packages. There should be no performance difference between
the two.
Hopefully this helps. Feel free to ask any more questions and I'll
follow-up with answers.

Related

Compile and reuse exe in Azure pipelines

In Azure DevOps, can I build a solution using the Visual studio Build task, publish the .exe file to the artifacts (or somewhere else, repo?) and then utilize that .exe file in another pipeline?
If so, to where and how should I publish it and then how do I reference it?
thanks
D.J. recommended possible solution, though I am using different approach with Universal Packages:
Once the binary is produced, the pipeline publishes it as Universal
Package to Artifact Feet
https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/universal-packages?view=azure-devops&tabs=yaml#publish-a-universal-package
Any other pipeline in project or organization can reference the Artifact Feed and utilize
the binary as part of the job
https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/universal-packages?view=azure-devops&tabs=yaml#download-a-universal-package
This solution requires more effort, since you have to create the Artifact Feed, but it is possible to use the published artifacts across projects within the organization. This is ideal when project produces libraries for integration. Other projects can reference the feed and use up-to-date libraries as part of their build.
Artifact feeds support Semantic Versioning. You can find more about Artifact Feeds in Azure DevOps here https://learn.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops
It only depends on what are your specific requirements.
Yes this is possible. You can use pipeline-artifacts for a start. The artifacts will be associated with the pipline, you'll have a task for publishing at the end of the pipeline that creates the exe-file and downloading at the start of the other pipeline that re-uses that exe.
See this for reference -> https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azure-devops&tabs=classic

How To Group Azure DevOps Build Artifacts From Multiple Projects Into One Release Pipeline By Just Build Artifact Tag

All the project builds for release 3 have been tagged with relese3. Out of 100 projects I'm not sure which ones are release3. I need to group all the build artifacts from each project tagged with release3 into one release pipeline. Is there a way to add build artifacts to a release by just build artifact tag?
Don't know which projects are tagged release3:
Is there any way to group build artifacts from multiple projects into one release pipeline by just build artifact tag?
Or can one release pipeline just use the Azure Trigger Pipeline task to trigger all project release pipelines with a build tag of release3?
How To Group Azure DevOps Build Artifacts From Multiple Projects Into One Release Pipeline By Just Build Artifact Tag
I am afraid there is no such way to do this at this moment.
As we know, in the release pipeline, we need to specify the pipeline which need to be deployed.
We cannot leave the option source(build definition) blank (it is required). in addition,
If this function is supported, there will be a certain risk, because the release pipeline is directly related to production, and tags are used to bind all related build pipelines, which makes if our development engineers accidentally use the wrong tag, or in the wrong If the tag is added to the pipeline, the wrong build artifact will be released to the actual production environment because the pipeline is not clearly specified in the release pipeline. will cause losses.
If you feel this feature is important to you, you could add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/report?space=21&entry=suggestion), which is our main forum for product suggestions. Thank you for helping us build a better Azure DevOps.

Azure DevOps 2020 - how do I select which artifacts to download for a release pipline (18.170.30525.1 (Azure DevOps Server 2020))

I have a build pipeline with 2 publish artifacts.
In my release pipeline i want to download just the first artifact.
I know that it should be possible as I have read here
In Azure Pipelines, you can, however, select which artifacts you want to download to the agent for a specific job and stage of the deployment. Typically, you will do this to improve the efficiency of the deployment pipeline when the tasks in that job do not require all or any of the artifacts, or if you implement custom code in a task to download the artifacts you require.
but I cant find it...
This is how the release job details look like:
as you can see the artifact selection is missing.
here is how I configured the artifact in the release pipe:
apparently there is an issue with on premiss none NTLM agents.
https://developercommunity.visualstudio.com/content/problem/520932/azure-devops-server-2019-where-is-partially-downlo.html
Partial artifacts feature isn't enabled by default in Azure DevOps Server 2019. We have an issue with "Download Build artifacts" not working with NTLM based proxy hence we couldn't roll out this feature to OnPremise customers.

Azure DevOps release pipeline triggered by existence of all (not any) of multiple artifacts?

Azure DevOps release pipelines let me specify multiple input artifacts but automated triggering only happens for the primary artifact. Is there a way to do a 'wait all' type operation on N input artifacts so that my release pipeline only starts when each artifact has a version available that matches some specified value?
For instance, say I make a commit M in a repo which has multiple different CI jobs A and B which take very different amounts of time. One CI job (A) creates a NuGet package as an artifact in minutes, the other CI job (B) takes hours to create VM images. I want a release pipeline which will use the NuGet package and VM image as inputs. But if I simply use the latest version of A and B as an input artifact in a release pipeline with a CI trigger on the primary artifact (either A or B) then when the release triggers it could be using mismatched versions of artifacts as 10 NuGet packages from 10 different commits are complete before I even get 2 VM images made by the other CI pipeline. I thought maybe build/artifact tags could solve this so that my release waits for artifacts which all have the same tag but I can't use variables in build/artifact tag filters which makes this not really amendable to any sort of automated scheduled/trigger.
Is this some good pattern for this type of workflow?
For this issue , based on your workflow, I am afraid that it is impossible to achieve a fully automated release. Enabling the Continuous deployment trigger will create a new release every time when a new build is available. Since the two artifacts are not generated at the same time, the two matching artifacts cannot be used as the source in automatic release.
To use specific artifacts as source in a release, we usually specify the version in Artifact. But this can't achieve continuous deployment. One way is to merge jobs A and B to generate an artifact, so that you don’t need to worry about the corresponding issues of artifacts, but according to your actual situation, I ’m not sure about the feasibility of this.
do a 'wait all' type operation on N input artifacts so that my release
pipeline only starts when each artifact has a version available that
matches some specified value
Apart from the negative answer, I think what you want is a good idea! So I post a feature request here in DC forum. You could vote that suggestion ticket and share your comment there.The product team would provide the updates if they view it. Thank you for helping us build a better Azure DevOps.

confusion on Azure DevOps pipelines

I've recently been working on switching from On premise TFS to Azure DevOps, and trying to learn more about the different pipelines and I think I may have had my Build pipeline do too much.
Currently I have my Build Pipeline do
Get Source code from Repo
Run database scripts/deploy dacpacs
Copy files over to virtual machines that have web application set up already
Run unit/integration tests
Publish the test results
I repeat these steps closely multiple times, one for develop branch, one for current and previous release branch.
But if I want to take advantage of the Releases and Deployments areas what would that really get me?
It looks like it would be easier to say yes this code did make it out to this dev/beta environment.
I'm working with ColdFusion code that includes some .NET webservices within the repo, would I have to make an artifact that zips up the repo and then deploys it, or is there a better way to take advantage of the release pipeline?
It's not necessary to make an artifact that zips up the repo and then deploys it. There are several types of tools you might use in your application lifecycle process to produce or store artifacts. For example, you might use version control systems such as Git or TFVC to store your artifacts. You can configure Azure Pipelines to deploy artifacts from multiple sources. Check the following link for more details:
https://learn.microsoft.com/en-us/azure/devops/pipelines/release/artifacts?view=azure-devops#sources