The latest version of azure-storage-blob for python sdk does not support AzureStack

Prateek Yadav 21 Reputation points
2021-06-23T16:45:18.417+00:00

Hi,

I am using the latest version of azure-storage-blob (12.8.1).
While creating the object of BlobServiceClient or ContainerClient, I get the following error:

ValueError: Unable to determine account name for shared key credential.

I checked the SDK code and found that the account_url needs to have 'core' in it.
for ex: https://<storage-account-name>.blob.core.windows.net/
Please see the below code snippet from base_client.py

account = parsed_url.netloc.split(".{}.core.".format(service_name))

But in the case of AzureStack, the account_url contains location in place of core. Because of which the account_url
parsing fails.

I am using this method to create the object of BlobServiceClient:

blobServiceClient = BlobServiceClient(account_url=<blob_service_url>, credential=<storage_account_access_key>, api_version="2019-02-02")

Is there any alternate way to get the object of BlobServiceClient or ContainerClient?
Or is there any such request already created to resolve this?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,201 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.