Skip to content

Bad error messages when creating Storage Service Client from connection string #8002

@tjprescott

Description

@tjprescott

Whilst creating samples, I ran into some issues working with the Storage blob client. The basic repro looks like:

from azure.storage.blob import BlobServiceClient

# Some connection string here
connection_string = ""
client = BlobServiceClient.from_connection_string(connection_string)
containers = client.list_containers()
for container in containers:
    print(container.name)

If I supply an empty string, I get this error:

ValueError: dictionary update sequence element #0 has length 1; 2 is required

An error message like "Malformed connection string" would be more useful.

If I have typo in my BlobEndpoint in my connection string, the operation hangs for a couple minutes before returning:

azure.core.exceptions.ServiceRequestError: <urllib3.connection.VerifiedHTTPSConnection object at 0x10ae29890>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

I tried to enable logging so I could see the request/response traffic for this call, but I couldn't find guidance on how to do this.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.StorageStorage Service (Queues, Blobs, Files)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions