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:
Related
I have created a sample Website project with a single page having HellowWord.aspx and HellowWord.aspx.cs. I am trying to create an Azure DevOps build pipeline for this project. The following are the tasks I have added to my build package.
But the publish artifacts always contains the aspx and aspx.cs file. Not sure which tasks I am supposed to add to make the proper publish package. Which will create proper dlls for .aspx file instead of aspx.cs.
Publish build artifacts task has an argument Path to publish, which defines the folder or file path to publish. This can be a fully-qualified path or a path relative to the root of the repository. Wildcards are not supported. Variables are supported. Example: $(Build.ArtifactStagingDirectory). By default, this argument uses variable $(Build.ArtifactStagingDirectory).
So you need to check your Copy files task, to see what you have copied to $(Build.ArtifactStagingDirectory), and copy the correct files in this task.
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/copy-files?view=azure-devops&tabs=yaml
I am creating a build for ios using azure and I want to copy a certificate file to artifact folder created to use in the release pipeline.
I am using a copy task and after the task is done its job, I am not able to find a copied file at the desired artifact folder. there are answers for copy task but not working for my scenario.
or is there any way to access files from the source folder of build pipeline to from release pipeline?
You were using download secure files task to download the cert files. As below described: see here for more information.
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). Alternatively, downloaded secure files can be found in the directory given by $(Agent.TempDirectory)
The secure files are downloaded to directory $(Agent.TempDirectory) and its path can be referenced by $(mySecureFile.secureFilePath) if you set the reference name to mySecureFile
So that the copy files task of yours need to be configured as below: Set the Source Folder to $(Agent.TempDirectory) and Contents to the name of the secure files. See below example:
You can also set the Contents to $(certFile.secureFilePath) $(provisionFile.secureFilePath) if you set the Reference name of above download secure file tasks to certFile and provisionFile
More conveniently you can use download secure files task directly in release pipeline to download the cert files.
Then the secure files will be available in release pipeline, and can be referenced just like in the build pipeline.
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.
Using Azure Devops. Made pipeline using Visual Designer for .Net Desktop application. Trying to get the output (exe). I created a feed in the Artifacts but I don't see a way to specify it in the Pipeline configuration. In the build output for Copy files to $(build.artifactsstagingdirectory) it shows file copied
2019-01-11T01:10:27.4301461Z Copying D:\a\2\s\AzureDevopsSimpleTestApp\bin\Release\AzureDevopsSimpleTestApp.exe to D:\a\2\a\AzureDevopsSimpleTestApp\bin\Release\AzureDevopsSimpleTestApp.exe
2019-01-11T01:10:27.4327361Z Copying D:\a\2\s\AzureDevopsSimpleTestApp\bin\Release\AzureDevopsSimpleTestApp.exe.config to D:\a\2\a\AzureDevopsSimpleTestApp\bin\Release\AzureDevopsSimpleTestApp.exe.config
2019-01-11T01:10:27.4335836Z Copying
D:\a\2\s\AzureDevopsSimpleTestApp\bin\Release\AzureDevopsSimpleTestApp.pdb to
D:\a\2\a\AzureDevopsSimpleTestApp\bin\Release\AzureDevopsSimpleTestApp.pdb
The Publish Artifact step it says file uploaded successfully but where is it?? how can I download it? Thanks!
2019-01-11T01:10:27.8230580Z Uploading 3 files
2019-01-11T01:10:28.1382894Z File upload succeed.
2019-01-11T01:10:28.1382985Z Upload 'D:\a\2\a' to file container: '#/672188/drop'
2019-01-11T01:10:28.1383023Z Associated artifact 2 with build 3
https://imgur.com/a/aBIvlGq
https://i.stack.imgur.com/F56M0.png
https://imgur.com/a/EYbdNpq
how can I download it?
You could download it from Summary tab. For more information, please refer to the screenshot.
I cannot use the Publish Build Artifacts Task in a release-definition, I'm getting the following error:
ErrorHostTypeNotSupported: This task must run in a build to publish artifacts to Visual Studio Team Services/TFS.
So my question is:
How can I save a file from a release-definition?
Why I want to achieve this:
I'm using a Deploy to Kubernetes Task in my release definition (which deploys a microservice with a yaml file to azure aks), this yaml file is tokenized during the release (I'm replacing the build-id). So at the end, I want to be able to download this file for each release and to use it for a manual deployment (if necessary).
Thanks for your help.
There is no container for artifacts in Release Management, so you cannot use that task in Release.
As a workaround, you can use ##vso[task.uploadfile]local file path command in VSTS Task Logging Command to upload the file.
Upload user interested file as additional log information to the
current timeline record. The file shall be available for download
along with task logs.
To do this, add a powershell task in your release definition like below:
When you want to use the file, download the release logs as zip, the file will be included in it.