Azure / Azure/azure-devops-cli-extension

[Feature Request] Artifacts: inspecting directory structure & download specifiers?

Open
#1,042 3 comments 6 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

The Problem
---------------

Our team is using Azure DevOps to manage our builds, and every so often needs to download artifacts from pipelines. We wanted a CLI for doing so, and some research turned up the Azure CLI.

However, it doesn't look like the CLI has all the functionality which the DevOps website does.

For one, the website can detect whether an uploaded artifact is a folder, and will allow you to navigate the tree structure to download specific parts of the artifact. To illustrate, each folder has an individual download option on the UI

devops-ui

However, from what I can tell neither the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/pipelines/runs/artifact?view=azure-cli-latest) nor the [REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/artifacts?view=azure-devops-rest-4.1) supports this functionality. The list and download commands only work with the top-level files/folders themselves, and if an artifact is a folder then there's no way to download sub directories without downloading the entire thing.

Proposed Solution
--------------------

It would be very nice if we could do something like an `az pipelines runs artifact tree --run-id 9999` to get output something like what [GNU tree](http://mama.indstate.edu/users/ice/tree/) would produce. It would also be very nice to be able to download files via pattern matching, eg

`az pipelines runs artifact download --run-id 9999 --outfile outfile artifact1/log.txt`

at minimum and ideally things like

`az pipelines runs artifact download --run-id 9999 --outfile outfile artifact1/*.txt`

Hopefully I'm not missing existing functionality? And if not, would you consider adding this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.