Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

BlobClient chop off the name when the blob name contains # #1062

Open
kyaw-sint opened this issue Apr 20, 2022 · 0 comments
Open

BlobClient chop off the name when the blob name contains # #1062

kyaw-sint opened this issue Apr 20, 2022 · 0 comments

Comments

@kyaw-sint
Copy link

Which service(blob, file, queue, table) does this issue concern?

BlobClient service to read the blob.

Which version of the SDK was used?

Azure.Storage.Blobs - Version="12.10.0-beta.2"

Which platform are you using? (ex: .NET Core 2.1)

.NET Core 3.1

What problem was encountered?

blobClient.ExistsAsync() return false when reading the blob if the blob name contains # character even though the blob is there physically. I noticed that blobClient.Name was chop if the blob name contains #. So, it can be the issue that causing blob not found since the blob name in the blobClient is already wrong.
E.g. Original blob name "2f00c93f-1cfb-4586-a89b-9eb80314a8bc_TEST # for UPLOAD.pdf". blobClient.Name showed "2f00c93f-1cfb-4586-a89b-9eb80314a8bc_TEST " after creating BlobClient instance which is chopped off before #.

How can we reproduce the problem in the simplest way?

You can use the blob name which contains # and create BlobClient with managed identity and try to read the blob from the blob storage.

// Construct the blob container endpoint from the arguments.
string containerEndpoint = string.Format("https://{0}.blob.core.windows.net/{1}/{2}", accountName, containerName, blobName);

// Get a credential and create a service client object for the blob container.
BlobClient blobClient = new BlobClient(new Uri(containerEndpoint), new DefaultAzureCredential());

https://docs.microsoft.com/en-us/azure/storage/blobs/authorize-managed-identity

Have you found a mitigation/solution?

No.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant