Azure / Azure/azure-cli-extensions

Cannot upload file to Azure File if the override path parameter w/o file extension

Open
#6,213 2 comments 0 reactions 1 assignee Claimed by @evelyn-ys View on GitHub
Azure CLI Team question Storage
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

- If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at [Azure/azure-cli](https://github.com/Azure/azure-cli/issues)

### Related command

`az storage file upload -s my-share --sas-token ....... --account-name my-account -p resources/172dd4a0366000604e2c4de41457aa1eb3093bb59ead22e0f1d472a2aaade094-2023041708-34890e81-cea8-4910-a887-26b25897f7a7 --source my-local-file`

### Extension name (the extension in question)
storage-preview

### Description of issue (in as much detail as possible)

According to the help message, the `-p` parameter says "The path to the file within the file share. If the file name is omitted, the source file name will be used."
With the given command, "my-local-file" should be upload to destination `resources/172dd4a0366000604e2c4de41457aa1eb3093bb59ead22e0f1d472a2aaade094-2023041708-34890e81-cea8-4910-a887-26b25897f7a7`. But actually, it tries to upload to `resources/172dd4a0366000604e2c4de41457aa1eb3093bb59ead22e0f1d472a2aaade094-2023041708-34890e81-cea8-4910-a887-26b25897f7a7/my-local-file` because of this [code snippet](https://github.com/Azure/azure-cli-extensions/blob/5c605d5ce49cd05c161e12ade746a058ef21b1b9/src/storage-preview/azext_storage_preview/_validators.py#L375-L377)

I want a way to upload my local file to my given destination, because I don't have any other access to other file path but only this one.

-----

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.