0

So I'm trying to create a new Container in Azure Storage. I want to store csv files as blobs that can be used to generate Power BI reports.

The first step itself is giving me an error. It is strange how the same code has worked in the past but is not working now.

Can you guys spot any error in this?

from azure.storage.blob import BlockBlobService, PublicAccess
block_blob_service = BlockBlobService(account_name='myaccount', account_key='mykey')
container_name ='decipher'
block_blob_service.create_container(container_name)

AzureException: HTTPSConnectionPool(host='myaccount%20.blob.core.windows.net', port=443): Max retries exceeded with url: /decipher?restype=container (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000002D24D433CC0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

1 Answer 1

1

I'd double check the imports required are installed: from azure.storage.blob import BlockBlobService , then trying from a different env, such as PS vs cmd, or Ubuntu terminal, this could be also from azure end if your request was dropped. I just tried and was able to create a container:

from azure.storage.blob import BlockBlobService
block_blob_service = BlockBlobService(account_name='storagename', account_key='somekey')
container_name = 'adamnewcontainer'
block_blob_service.create_container(container_name)
Sign up to request clarification or add additional context in comments.

1 Comment

it worked! I had added an extra space while calling the account name ->(account_name='myaccount ', account_key='.....') Thanks for the help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.