VS402864: No artifact type found corresponding to id PipelineArtifact - azure-devops

I am using a Azure DevOps/VSTS release pipeline to deploy artifacts created during a build, but I am unable to explore the artifacts in the pipeline editor.
VS402864: No artifact type found corresponding to id PipelineArtifact.
Make sure that the artifact type extension is available and try again.
I am able to explore the artifact contents just fine on the build summary.
What am I doing wrong?

It looks like you're using the new (in preview) Pipeline Artifacts feature. Based on the dates of the discussion at the bottom of the Publish Pipeline Artifacts task documentation, I think there are still some defects to be worked through to get it out of preview.
I'd recommend you use Copy Files and Publish Build Artifacts until it comes out of preview.

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

Azure Pipeline artifacts do not show under Storage

I have created a c++ pipeline where the output of the build pipeline is published to drop container. The structure is the following
drop/v1.0.0/Release/MyService.dll
drop/v1.1.0/Release/MyService.dll
drop/v1.1.0/Release/MyService.dll
My engineers will need to view drop folder and according to the version that needs to be manually deployed to a client the will download the dll file.
As far as I understand there is not any way to view them under Artifacts (what a shame). I go to the project settings under Storage but I cannot view them either there. Only place that I am able to find them is under the pipeline run and then I have to find in which version of the pipeline run a specific service version was produced. This is a maze. We have dozens of c++ projects and we have to keep track of which pipeline version run of each project matches the service version.
Is there any way to be able to access them like in a folder structure?
You could use Builds - List via rest API to get all the builds for a pipeline, then use : Artifacts - List rest API to get all the artifacts for a build. It will list all the download URL for artifacts, then you could download them together or choose the one you want to download.
Besides, you could use the publishLocation argument in publish build artifacts task to copy the artifacts to a file share (FilePath). And the file share must be accessible from the agent running the pipeline. In this way you could publish all your artifacts to the file share you want for better management.
In addition, you could also use Universal Package task to publish your artifacts to your feed for better review.

Where is the location of Release Artifacts on TFS/Azure DevOps

Can anybody tell me where the Release Artifact comes from when you use it in a Release Definition?
I’m currently using TFS on-prem (v15 Update 1) to handle undertake Build & Release. I believe this version is very close to what the current Azure DevOps documentation describes as ‘Classic’.
I have a Build Definition that outputs an Artifact to the default local path on the agent (c:\agent_work\1\a) using the Build.ArtifactStagingDirectory. I also publish/copy the artifact to a network share.
I have a Release Definition which references the Build Definition as a Linked Artifact Source. Therefore, when I create a new release where does the Release Definition get the Artifact Does it get it from my published network share? Does it get it from Source Control? How do I know it’s getting it from TFS or Network Share?
I know the Build.ArtifactStagingDirectory gets deleted on every build, so I know it can’t be from that location.
You tied your release definition to a build definition. Build definitions can publish artifacts when they run.
Your release definition looks at a build run, looks at the artifacts it published, and then retrieves them from whatever location to which they were published. This can be a file share, or it can be within the TFS/Azure DevOps instance itself. Not source control or Azure Artifacts, but rather a completely internal store just for builds.
Now to directly answer your question:
How do you know where the artifact came from? By looking at the build run. How do you know where the artifacts are going to be published in the future? By looking at the build definition.

How to download multiple build artifacts in a Release pipeline on Azure Devops?

I am trying to create a Releasing stage that is meant to download 3 different build artifacts from 3 different pipelines in a project and deploy them on a target machine. When I create a release and deploy it on the target machine, the very first download build artifact task works fine but none of the following ones and I see the following error
"Artifact [buildnumber] not found for build [buildId]. Please ensure you have published artifacts in any previous phases of the current build."
Has anyone else seen this error or know why I am getting this error?
Thank
If you want to use Download Build Artifacts task to download different build artifacts from different pipelines, please select the “Specific build” option to find that particular artifact, as below.
If you use the default value: Current build, of course this task cannot find other build artifacts from other build pipelines. And then you will encounter this issue.
In addition, the new release will automatically download artifacts in below pre-defined “Download Artifacts” step.
Therefore, you could just add these 3 artifacts in release pipeline, and then you don’t need to use additional Download Build Artifacts task to download these artifacts. See: Release artifacts and artifact sources for details.

.NET Core WebJob Console App CI/CD using Azure DevOps Pipelines

I'm trying to build my console application through Azure DevOps. So to this I'm following this tutorial.
The follow images, are from what I already did.
Build Solution Pipeline
Build Solution Pipeline / Publish
Build Solution Pipeline / Artifact
Deploy WebJob Pipeline
Deploy WebJob Pipeline / Variables
When I run the Build Solution the zip seems to work, because I see it.
But when I run the Deploy WebJob Pipeline I get ##[error]D:\a\1\s\***.zip not found.. I tried wwwroot/App_Data/jobs/, but still the same error.
What could I be doing wrong? What's the right way to set the zippedArtifactPath?
You're following the tutorial incorrectly. The tutorial is telling you to create a release. You're using a build pipeline to try to release. Although you can do that, you shouldn't.
You have two options:
If you want to keep using the visual designer, use a release. Look at the "Release" tab for this. Releases can be tied to build artifacts and will handle downloading the build artifact automatically.
If you want to use YAML, refer to the YAML documentation and set up a multi-stage pipeline to release.
What could I be doing wrong?
Check your error messgae ##[error]D:\a\1\s\***.zip not found we can find in the second build pipeline, the PS tried to get the xx.zip in xxx\s folder while in first build pipeline you published the xx.zip to xxx\a folder.
The $(System.DefaultWorkingDirectory) for build pipeline is xx\s folder while that for release pipeline is xx\a folder. In first build pipeline we published the xx.zip to Build.ArtifactStagingDirectory which is a xx\a folder, so we can't access the xx.zip from xx\s folder in second build pipeline's PS script.
What's the right way to set the zippedArtifactPath?
It's not recommended to build and deploy one web app using two build pipelines. For normal logic, we should do this by using combination like build+release pipeline just like the Toturial and Daniel suggests above.
We can use this variable $(Release.PrimaryArtifactSourceAlias) to get the artifact directory.
In your powerShell script you can set path variable like:
$path = "$(System.DefaultWorkingDirectory)\$(Release.PrimaryArtifactSourceAlias)\webjobs_drop\[ZIP_File_Name].zip"
[your build artifact name]\webjobs_drop[your zipped files].zip
"your build artifact name" - you should get it from your release pipelines Artifacts stage from where you are selecting your build artifacts