[Storage-blob] ContainerClient encodes blobName including folder which produces are problematic url
See original GitHub issue- Package Name: storage-blob
Describe the bug
The problem is this line. It encodes the blobName, but the blobName can also include a folder, like folderA/blob.txt
.
This produces the following URL:
https://mystorageaccount.blob.core.windows.net/my-container/folderA%2Fblob.txt
This is fine most of the time, but if you want this to work with an Apache proxy you have to set AllowEncodedSlashes
, see Apache docs.
To Reproduce Steps to reproduce the behavior:
const sasUrlToContainer = 'https://mystorageaccount.blob.core.windows.net/my-container?[sasQueryParameters]';
const blobName = 'folderA/blob.txt';
const client = new ContainerClient(sasUrlToContainer);
const blobClient = client.getBlockBlobClient(blobName);
const result = await blobClient.download();
Expected behavior The encoding should only include the filename but not the folder name.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
[BUG] Azure.Storage.Blob 12.6.0 changed url encoding ...
Describe the bug Version 12.5.1/12.6.0 is encoding / chars in the filename, so when I pass some/path/file.json to BlobContainerClient.
Read more >azure.storage.blob.ContainerClient class | Microsoft Learn
Returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.
Read more >Python - List all the files and blob inside an Azure Storage ...
Here is how the code goes when you are trying to list all the blobs names inside a container. generator = blob_service.list_blobs(CONTAINER_NAME) ...
Read more >Cheat Sheet: Microsoft Azure Blob Storage - Zuar
People often think of the container as the directory in the above example, and try to create folders within the containers to replicate...
Read more >azblob - Go Packages
Package azblob allows you to manipulate Azure Storage containers and blobs objects. URL Types ¶. The most common types you'll work with are ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The fix has been released in @azure/storage-blob@12.12.0.
.NET does not encode ‘/’. We will want to do the same too: https://github.com/Azure/azure-sdk-for-net/blob/0ce8e17b4dee01d7d3c2e0aff6977706d448eee0/sdk/storage/Azure.Storage.Common/src/Shared/StorageExtensions.cs#L12-L28