question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
EmmaZhucommented, Oct 27, 2022

The fix has been released in @azure/storage-blob@12.12.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found