Blob upload - Bad Request - Invalid URL when special character and UTF-8 4 byte character in the name

Klaudia Knafel 1 Reputation point
2022-04-14T09:54:34.6+00:00

Hello,

I am experiencing an issue when trying to upload files to a blob. Problem occurs when filename contains a unicode character from (from [Specials]1 block: U+FFF9, U+FFFA, U+FFFB, U+FFFC, U+FFFD) together with unicode character that is written on 4 bytes (for example U+1F30D, U+1F3D3, U+1F3D2) so when the name of the file is for example. When these characters are alone in the file name it works just fine, upload of file name with just U+1F30D or just U+FFFD works. The order of the characters does not matter, neither do existence of other characters.

I tried uploading them via azure portal, it fails with error:
Failed to validate file names.

Via azure storage explorer it returns message 'Could not check destination file existence' and a 400 Bad Request.
Via az copy command returns 400 Bad Request with message: 'HTTP Error 400. The request URL is invalid'

Example format of the request being sent by az copy; https://{storage-account-name}.blob.core.windows.net/{container-name}/%F0%9F%8C%8D%EF%BF%BDtest?timeout=901

Is there any information that would clarify this issue? Is there a way to workaround or solve this issue?

Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
259 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,843 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SaiKishor-MSFT 17,231 Reputation points
    2022-04-15T22:52:40.493+00:00

    @Klaudia Knafel Thank you for reaching out to Microsoft Q&A. I understand that you are having questions regarding uploading files to Blob storage where it is throwing the error- Failed to validate file names. when you use special characters in the names such as Unicode characters. Please correct me otherwise.

    Please check out the below Notes regarding Blob and Container names that are supported and not supported as per the Naming and Referencing Containers, Blobs, and Metadata:

    Blob and container names are passed to the Blob service within a URL. Certain characters must be percent-encoded to appear in a URL, using UTF-8 (preferred) or MBCS. This encoding occurs automatically when you use the Azure Storage client libraries. However, there are certain characters that are not valid in URL paths even when encoded. These characters cannot appear in blob or container names. Code points like \uE000, while valid in NTFS filenames, are not valid Unicode characters, so they cannot be used. In addition, some ASCII or Unicode characters, like control characters (0x00 to 0x1F, \u0081, etc.), are also not allowed. For rules governing Unicode strings in HTTP/1.1, see RFC 2616, Section 2.2: Basic Rules and RFC 3987.

    Hope this helps. Please let us know if you have any further questions and we will be glad to assist you further. Thank you!

    Remember:

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

    Want a reminder to come back and check responses? Here is how to subscribe to a notification.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.