Azure / Azure/azure-cli

Upload to blob always fails with authentication error

Open
#15,232 9 comments 0 reactions 1 assignee Claimed by @Juliehzl View on GitHub
act-codegen-extensibility-squad Customer Usage feature-request Service Attention Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**

I have a storage blob that I can, with the account used, upload, download and delete blobs from the portal without any issue. I've confirmed the account is being used and functional. I've run az login tons of times and can read all the data including from the blob.

I'm calling the following command to upload:

az storage blob upload --account-name $STORAGE_ACCOUNT --container-name $CONTAINER --name $NAME --file $EXPORT_PATH --auth-mode login

The error is:
Authentication failure. This may be caused by either invalid account key, connection string or sas token value provided for your storage account.

Happens with every account I try. If I use the depricated --auth-mode key it works just fine.
**To Reproduce**

1. Create storage account
2. Assign permissions to proper account
3. Create file
4. Run blob upload command

**Expected behavior**

This should initiate blob upload
**Environment summary**

Windows 10 pro with pip installed Azure CLI v2.11.1
**Additional context**

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.