question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
inc0commented, Sep 18, 2020

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 call

1reaction
inc0commented, Sep 18, 2020

After 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found