Publish Pipeline Artifacts

Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020

Azure Artifacts enable developers to store and manage their packages and control who they want to share it with. Pipeline Artifacts are generated after you build your application. The output can then be deployed or consumed by another job in your pipeline.

Publish Artifacts

Note

Publish pipeline artifacts is not supported in release pipelines. It is only supported in build pipelines, multi-stage pipelines, and yaml pipelines.

You can publish your Artifacts at any stage of your pipeline using YAML or the classic editor. You won't be billed for storing your Pipeline Artifacts or using Pipeline caching.

- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Pipeline.Workspace)'
    publishLocation: 'pipeline'
    artifact: 'drop'
  • targetPath: (Required) The path of the file or directory to publish. Can be absolute or relative to the default working directory. Can include variables, but wildcards are not supported. Default value: $(Pipeline.Workspace).

  • publishLocation: (Required). Artifacts publish location: choose whether to store the artifact in Azure Pipelines, or to copy it to a file share that must be accessible from the pipeline agent. Options: pipeline, filepath. Default value: pipeline.

  • artifact: (Optional) Name of the artifact to publish. If not set, defaults to a unique ID scoped to the job.

Publish Artifacts from the command line

If you want to manually publish your Artifact, run the following command in an elevated command prompt:

az pipelines runs artifact upload --artifact-name your_artifact_name --path your_path_to_publish --run-id '<artifact_run_id>'

View published Artifacts

When your pipeline run is completed, you can view or download your published Artifact as follows

  1. Select your pipeline run, and then select the Summary tab.

  2. Select the published Artifact in the related section.

    View published Artifact

  3. Expand the drop folder and find your Artifact.

    View the drop content

  4. Download your pipeline Artifact and explore its content.