Skip to content

[BUG] Storage clients don't parse escape sequence in connection strings #50253

Open
@sebastienros

Description

@sebastienros

Library name and version

Azure.Storage.Blobs

Describe the bug

When creating a BlobServiceClient from a connection string, if a key/value uses " to enclose its values then the client throws an exception.

Example:

new BlobServiceClient("DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=\"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==\";BlobEndpoint=http://127.0.0.1:50606/devstoreaccount1;");

This is the case when using DbConnectionStringBuilder to build/remove elements from a connection string, it will see the AccountKey has special chars ('=') and encode the value.

Expected behavior

Escape the values by handling escape sequences and surrounding double quotes.

Actual behavior

Throws an exception with the generic message: "No valid combination of account information found."

Reproduction Steps

new BlobServiceClient("DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=\"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==\";BlobEndpoint=http://127.0.0.1:50606/devstoreaccount1;");

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions