-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: blob name and container name max length limitation #291
Comments
Hi Yang, The azure-storage-cpp SDK itself doesn't have any limitation on the length of blob name. It just encodes it and sends it out in HTTP request. I did some test about the issue you mentioned. (The following conclusions are mostly based on speculation and possibly wrong and may change in the future.) The emoji character The Chinese character So I guess in the doc you quoted, A character means UTF-16 encoded 2-byte character. Since you are working on Linux, where the default encoding is usually UTF-8, the length of a string(either in bytes or in characters) is usually not the same as encoded in UTF-16. Plus, blob name always appears in URL. It will be encoded if there are any non-ascii characters, making the URL even longer. Some browsers may not be able to handle it if it exceeds some limit. |
That actually makes perfect sense. Thanks. |
@JinmingHu-MSFT
The code above actually worked and created a long objname with four letter "A" in front, 264 smiley face emoji in between and ended with a "A". It went beyond 1024 wchar limit! and I used az CLI to have verified the blob name. Also if I use az CLI with that long name (emoji, ascii, or kanji) > 1024 wchar, it will generate the OutOfRange error as expected: OutOfRangeInput One of the request inputs is out of range.
RequestId:d466f9b6-a01e-012b-576b-6ed45e000000 Any thoughts? I can't figure out why. |
@yxiang92128 What do you mean by "replace the emoji with letter A"? Since emoji is 4 bytes in UTF-8, you mean replace 1 emoji with four As or only one A? |
@JinmingHu-MSFT I might be doing something wrong here but I couldn't figure out why yet. |
@yxiang92128 Character In your situation, objname is 1025 |
We're going to close this issue because of inactivity, feel free to reopen it if you have any further questions. |
From this doc:
https://docs.microsoft.com/en-us/rest/api/storageservices/Naming-and-Referencing-Containers--Blobs--and-Metadata?redirectedfrom=MSDN
"A blob name must be at least one character long and cannot be more than 1,024 characters long, for blobs in Azure Storage."
Can you clarify what it means by "characters"? Because it seems like we could create a blob with 1024 wide characters (e.g. kanji or emoji), then when we use the SDK trying to access that blob with the blob name specified in 1024 wide characters, it will throw an exception:
with http code=<400>
We wonder if it is a limitation on SDK side.
Thanks,
Yang
The text was updated successfully, but these errors were encountered: