Can we copy data from azure file share to azure artifacts - azure-devops

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.

Related

Require to store Publish Artifacts of each stages in single directory over azure pipeline

Each stages stores its own publish artifacts, but can we store it in a common place where we keep placing publish artifacts of every build and download from there as an when require ?
And also that common storage should not be azure repository nor azure blob storage, instead simply over azure pipeline.
Publish pipeline artifact out of the box supports to publish artifact to file share on Azure Storage Account. However if you want to put your arifacts outside of Azure you need to consider external provider like Artifactory. There is no other options out of the box. However keep in mind that your aritifacts are mostly archive so you can even upoad then to FTP if you want, however the question is actually why you need this and if benefit is greater than effort.
Require to store Publish Artifacts of each stages in single directory over azure pipeline
I am afraid it is impossible to store Publish Artifacts of each stages in single directory over azure pipeline.
That because the azure pipeline is used for building and publishing, not for storage. It will only temporarily store the artifacts generated by the pipeline associated with the pipeline.
For your situation, you could create a network folder, then publish the artifact to the network folder for each stage:

Is there an equivalent of GitHib releases in Azure DevOps?

Simply speaking, does Azure Devops have something that works very close to GitHub releases?
I would like to publish artifacts that are created during an Azure DevOps pipeline so that they be easily viewed and downloaded afterwards in a central location. The closest equivalent to what I'm looking for is how GitHub releases work, where there is a web page listing out all the versions of the repository and the assets that can be downloaded for each version.
It seems to me that published artifacts within Azure DevOps pipelines are always tied to the run of the pipeline, and there isn't an easy way to see one list of artifacts that have been created in a historical view like GitHub releases provides, but maybe I'm missing something.
Azure Artifacts does not meet my needs because it is tied to particular packaging formats and is meant to be used for developer tooling.
I would like to publish artifacts that are created during an Azure
DevOps pipeline so that they be easily viewed and downloaded
afterwards in a central location.
As a workaround ,you can switch Artifact publish location to A file share in Publish Pipeline Artifacts task then specify your network drive folder path.
Specifying the path to the file share where you want to copy the files. The path must be a fully-qualified path or a valid path relative to the root directory of your repository. Publishing artifacts from a Linux or macOS agent to a file share is not supported.
Besides, there should be no other built-in hosting, I am afraid that Azure Artifact is the closest to your needs. because it is tied to particular packaging formats you can consider using Universal Packages.

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.

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

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.