共用方式為


Publish and download build artifacts

TFS 2018

Azure Artifacts enables teams to use feeds and upstream sources to manage their dependencies. You can use Azure Pipelines to publish and download different types of artifacts as part of your CI/CD workflow.

Publish artifacts

Artifacts can be published at any stage of your pipeline. You can use YAML or the classic Azure DevOps editor to publish your packages.

YAML isn't supported in TFS.

Example: Use multiple tasks

YAML isn't supported in TFS.

Example: Copy and publish binaries

YAML isn't supported in TFS.

Download artifacts

YAML isn't supported in TFS.

Note

If you're using a deployment task, you can reference your build artifacts using $(Agent.BuildDirectory). See Agent variables for more details.

When your pipeline run is completed, select Artifacts to download your artifact.

Published build artifact TFS

Publish from TFS to a UNC file share

If you're using a private Windows agent, you can set the artifact publish location option (TFS 2018 RTM and older: artifact type) to publish your files to a UNC file share.

Note

Use a Windows build agent. This option doesn't work for macOS and Linux agents.

Choose file share to copy the artifact to a file share. Common reasons to do this:

  • The size of your drop is large and consumes too much time and bandwidth to copy.

  • You need to run some custom scripts or other tools against the artifact.

If you use a file share, specify the UNC file path to the folder. You can control how the folder is created for each build by using variables. For example: \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber).

Tips

  • Disable IIS Basic Authentication if you're using Azure DevOps Server to allow authentication with your Personal Access Token. See IIS Basic Authentication and PATs for more details.

  • Use forward slashes in file path arguments. Backslashes don't work in macOS/Linux agents.

  • Build artifacts are stored on a Windows filesystem, which causes all UNIX permissions to be lost, including the execution bit. You might need to restore the correct UNIX permissions after downloading your artifacts from Azure Pipelines or TFS.

  • Build.ArtifactStagingDirectory and Build.StagingDirectory are interchangeable.

  • Build.ArtifactStagingDirectory path is cleaned up after each build.

  • Deleting a build associated with packages published to a file share will result in the deletion of all Artifacts in that UNC path.

  • If you're publishing your packages to a file share, make sure you provide access to the build agent.

  • Make sure you allow Azure Artifacts Domain URLs and IP addresses if your organization is using a firewall.