Azure / Azure/azure-cli

az storage download example fails

Open
#19,598 2 comments 1 reaction 1 assignee Claimed by @evelyn-ys View on GitHub
act-codegen-extensibility-squad feature-request Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

The docs don't show an example of `az storage file download` but they do show an example of `az storage file download-batch` which is this:

```
az storage file download-batch --account-key 00000000 --account-name MyAccount --destination . --no-progress --source /path/to/file
```

Note the source path starts with a `/`

When I run the `az storage file download` command from my windows machine via powershell, and use a similar format path to the file I want to download, I get back an error:

```
az storage file download --path /some/path/readme.txt -s mystorage--account-key [account-key]

```

> The specifed resource name contains invalid characters. ErrorCode: InvalidResourceName
InvalidResourceNameThe specifed resource name contains invalid characters.
RequestId:02608e12-e01a-002d-24b3-ab66cb000000
Time:2021-09-17T10:59:29.9470471Z

However if I remove the leading slash from the path it works.

So with `download-batch` the example shows using a leading slash, but if you use that same format for `file download` it errors. Perhaps an example should be added for downloading a single file to clarify, and perhaps the cli `file download` command could be made more robust to cope with a leading slash..

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: c633bcb6-d7c0-8bfe-76b6-c69fed9eaf90
* Version Independent ID: 6b2e9a7e-c75f-0b48-0794-acd0ba474eba
* Content: [az storage file](https://docs.microsoft.com/en-us/cli/azure/storage/file?view=azure-cli-latest)
* Content Source: [latest/docs-ref-autogen/storage/file.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/latest/docs-ref-autogen/storage/file.yml)
* Service: **storage**
* GitHub Login: @rloutlaw
* Microsoft Alias: **routlaw**

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.