az storage blob upload not overwriting / issue with entity
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Related command
az storage blob upload -f <path-to-file> --account-name <storage-account> -c dev -n <path-to-upload-in-container> --overwrite true --% --sas-token "sp=racwdlmeop&st=2022-09-05T03:56:59Z&se=2022-10-01T11:56:59Z&spr=https&sv=2021-06-08&sr=c&sig=[redacted]"
Describe the bug and To Reproduce
My goal has been to dynamically create a directory and upload a file to it. The name of directory is set using pscore with ${date} = Get-Date -Format "yyyy/MM/dd"
so that the directory of my file and path to directory in blob would be 2022/09/05/file.txt.
az config set extension.use_dynamic_install=yes_without_prompt
So I can use storage-preview as it asks for it.
az storage fs directory create -n dev/${date} -f dev --account-name $(StorageAccount) --% --sas-token "$(SASToken)"
The --% as the SAS token in ps thinks it a command otherwise.
Then do the upload command gives:
Argument '--overwrite' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The requested operation is not allowed in the current state of the entity.
RequestId:7df8fed3-901e-0024-7fdc-c04548000000
Time:2022-09-05T04:01:03.3425146Z
ErrorCode:OperationNotAllowedInCurrentState
If you want to overwrite the existing one, please add --overwrite in your command.
Expected behavior It will say you need to overwrite yet the overwrite is in it already and the permissions for the SAS token are all permissions and the date is set to at least a month away so will not expire.
Environment summary
azure-cli 2.39.0
core 2.39.0
telemetry 1.0.6 *
Extensions:
azure-devops 0.25.0
storage-preview 0.8.3
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
These are my local versions but ideally I’m aiming to use azure-pipeline for this.
Additional context I feel like it’s an overwrite issue but could be SAS issue although I don’t think I’m generating it wrong. I’ve chosen all permissions multiple times and made sure date won’t expire. I also have Storage blob owner and contributor to the storage account. In Azure-pipeline I have to use ubuntu vm for this so either bash or pscore I can use for this but unsure.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
@Smoogles The action is currently pending on you to share the RequestId from the error response of most recent issue occurrence. Once you have these details, please feel free to reopen this issue, we would be happy to help.
Sorry been busy. Can I get back to you start of this week coming? I’ll try again when at work and will send it through.
Thanks
On Fri, 21 Oct 2022, 1:54 pm navba-MSFT, @.***> wrote: