Azure blob client fails with authz error while same operation is allowed via CLI
See original GitHub issue- Package Name: azure-storage-blob
- Package Version: 12.5.0
- Operating System: MacOS
- Python Version: 3.8
Describe the bug
This command:
az storage blob list --container-name mycontainername --account-name myaccount
works and returns list of blobs
in python:
ContainerClient(account_url="myaccount.blob.core.windows.net", container_name="mycontainername", credential=AzureCliCredential()).list_blobs()
Throws:
HttpResponseError: This request is not authorized to perform this operation using this permission.
RequestId:4d936591-701e-0031-078a-8c01ed000000
Time:2020-09-17T00:34:09.6826796Z
ErrorCode:AuthorizationPermissionMismatch
Error:None
Expected behavior Either python returning correct response or useful error message to pinpoint what’s wrong.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Azure Blob Storage fails to authenticate: "Make sure the value ...
Hi I am trying to upload a binary file (a blob for an excel file, actually) to my storage account but the client...
Read more >AzureStorage Blob Server failed to authenticate the request ...
I got an error while uploading files into Azure Blob storage with metadata, the error is "Server failed to authenticate the request. Make...
Read more >Azure DevOps Build Agent not able to access Azure Storage
It is failing only when it is done from an azure devops vm or the azure client from the portal itself. And the...
Read more >Troubleshooting | Cloud Storage
Issue : While performing a resumable upload, I received this error and the message Failed to parse Content-Range header. Solution: The value you...
Read more >Fixed – authorizationpermissionmismatch Azure Blob Storage
Description=This request is not authorized to perform this operation using this permission. ... Storage Blob Data Contributor role to the account.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
right, if you ask people to pull that key themselves, that requires this key to be stored in some secure manner, and that’s a lot to ask. I’d suggest giving a way in python sdk to pull that key on runtime using existing auth method. It already is available over API via
/subscriptions/<my sub id>/resourceGroups/<res group>/providers/Microsoft.Storage/storageAccounts/<my account>/listKeys
callAfter looking here we’ve added missing permission and it worked. I think CLI uses access keys under the hood. It may be good idea to document how to pull access keys and use them in python sdk too. I’ll close this issue for now