Download build artifacts from file share does not show drop folder content - azure-devops

At the end of the build, I publish artifacts to a file share drive.
But in the release pipeline, if I select the Agent job, I don't see the content of the drop folder, as shown below. Do I have to use a Download Build Artifacts task to go around this ? Or can I still use this option of the Agent job somehow ?
The artifacts were correctly published to the file share. However I also noticed that I cannot open the artifacts folder from the build log. I only see the path. How come ?

Download build artifacts from file share does not show drop folder content
This is an expected behavior. When we choose publish artifacts to a file share drive instead of Azure pipeline, the share drive can be our local path or a network shared folder.
So this share drive is more controlled by us than azure devops. In this case, Azure devops cannot provide a direct download link, only the path where we store the file.
Do I have to use a Download Build Artifacts task to go around this ?
Or can I still use this option of the Agent job somehow ?
It depends on whether your agent running your release pipeline can access your share drive.
If yes, just like Shayki Abramczyk said, the agent will download the artifacts from the file share at the beginning of release.
Note: You need set the build pipeline as artifact source:
The output:
If the agent could not access that share drive, we need use the task like Download artifacts from file share to download the artifact.
Hope this helps.

This is the behavior of publishing to a file share, you can't "explore" the files inside Azure DevOps if it stored on a file share.
You don't need to use the Download Build Artifacts task because the agent will download the artifacts from the file share at the beginning of his run.

Related

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.

Download lost file from DevOps pipeline Library

I lost a file which is still available in the library inside the DevOps Library.
Is there a way to save a local copy somehow?
It's still possible to use in a pipeline, but I have no idea to get it to my local computer.
You can use the Download Secure File task to download the file in the pipeline and then use Publish Build Artifacts task to publish the file as build artifacts.
See below when downloading using Download Secure File:
Once downloaded, use the name value that is set on the task (or "Reference name" in the classic editor) to reference the path to the secure file on the agent machine. For example, if the task is given the name mySecureFile, its path can be referenced in the pipeline as $(mySecureFile.secureFilePath)
So in the Publish Build Artifacts task set the Path to publish to $(mySecureFile.secureFilePath)
Then you can download the file from the build summary page by clicking the related artifacts. See below:

Can we copy data from azure file share to azure artifacts

Is it possible to copy files from Azure files shares to azure artifacts using build pipeline task?
Yes it is possible. What you need is actually download files for Azure Files and publish them to Azure Artifacts. Please check this topic where is shown a way how to download files from Azure Files.
Azure Artifacts is a package feed and thus it depends what kind of package you want to publish, so confoguration may differ. But if you want to publish this as build/pipeline artofacts you may simply use regular tasks.

How to manually publish a file to Azure Artifacts?

I have a file which I have created manually on my local computer. I need it in several Azure DevOps pipelines.
I want to use it as an "Artifact".
I know how to publish artifacts from within an Azure DevOps Pipeline, but this specific file I just want to upload from my computer. How can I do it?
How to manually publish a file to Azure Artifacts?
As we know, the essence of Artifact is the storage of a shared file. We can roughly get this information from the Publish build artifacts task:
But the default value of Artifact publish location is Azure Pipelines:
This is a shared place set up on Azure.
Update:
Thanks hey sharing:
We could upload from local to the shared place with AZ command line, like:
az artifacts universal publish --organization https://dev.azure.com/example/ --feed my_feed --name my-artifact-name --version 0.0.1 --description "Test Description" --path
Now let us return to the first sentence we started with "the essence of Artifact is the storage of a shared file", so we could create a shared place/folder to save the file. It is now seen as "Artifact". Then we just need make sure other pipelines could access this shared place/folder.
For example, we could create a folder on the server where our private agent is located, then we just need to copy your file to that folder. Now, we could use it when we build the pipeline with private agent. Obviously this is not limited to local folders, we can also create a network folder, only need to ensure that other pipelines can access it.
Hope this helps.
You have to push it through your package manager like NuGet, npm or anything else. But I guess better option would be commit and push this single file to specific repo (if this file is specific to single project) or common repo like "Utilities" (if you gonna reuse it across many projects) and then download this repo (or just file) in your pipeline.

how to deploy artifact of VM desktop?

I tried to copy task extension on azure pipeline: $vmFolder="c:/users/[username]/desktop and also tried
$vmFolder="c:/users/public/desktop but still my artefacts are deployed inside c:/azagent/work/ location. If anyone has an idea, please explain me the process step by step.
Could you provide a little more detail about what you're trying to achieve?
My feeling is that there may be a confussion about what is an Agent (C:\azagent\work is the work directory in a machine where you, very likely, have installed an Agent) and the Machine where you want to deploy your code to run.
Bests.
When you publish the build artifacts in Azure DevOps, for the location you could only choose "Server" or a UNC file share.
Artifact publish location argument:
Azure Pipelines/TFS (TFS 2018 RTM and older: Artifact type: Server)
is the best and simplest choice in most cases. This choice causes the
artifacts to be stored in Azure Pipelines or TFS. But if you're
using a private Windows agent, you've got the option to drop to a
UNC file share.
More details please refer our official doc -- Artifacts in Azure Pipelines
The remaining alternative is to add a download artifacts task in the end of pipeline to download your published artifacts to your Destination directory.