You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which service(blob, file, queue) does this issue concern?
blob
Which version of the SDK was used? Please provide the output of pip freeze.
Azure 4.0.0, blob 1.4.0
What problem was encountered?
When downloading a gzipped file that contains Content-Encoding: gzip through get_blob_to_stream, the file is automatically decoded. This was reported at #509. However, I find the workaround not to be maintainable since it messes with private method/classes. I believe this is a valid use-case, one may want a file to be decoded by the browser but not when fetching it through the API.
I'm waiting, too. The auto decode feature is really bad. We must change my all websites to AWS S3 which support gzip file with minimum transfer and high performance. I cannot think the reason why Azure do that.
We must change my all websites to AWS S3 which support gzip file with minimum transfer and high performance.
The file is decoded after it's downloaded. Performance is not really affected here. Azure does support gzip, the issue is just the python API doing this auto decoding which is quite unexpected.
Activity
zezha-msft commentedon Apr 12, 2019
Hi Esteban C Borsani (@nitely), thanks for reaching out!
I really appreciate your feedback. This is however a breaking change. We'll consider including it as part of a redesign effort.
markledwich2 commentedon Jun 1, 2020
I just hit this more than 1 year after it was reported. Cost me some time and patience 👎
MinhTraHong commentedon Mar 9, 2021
I'm waiting, too. The auto decode feature is really bad. We must change my all websites to AWS S3 which support gzip file with minimum transfer and high performance. I cannot think the reason why Azure do that.
nitely commentedon Mar 10, 2021
The file is decoded after it's downloaded. Performance is not really affected here. Azure does support gzip, the issue is just the python API doing this auto decoding which is quite unexpected.
zezha-msft commentedon Mar 10, 2021
Xiaoxi Fu (@xiafu-msft) We have an open item for track 2 linked here.
Has it been done yet? We didn't do this change in track 1 due to breaking behavior.
xiafu-msft commentedon Mar 10, 2021
Hi Ze Qian Zhang (@zezha-msft)
Here's the issue created by azure core Azure/azure-sdk-for-python#17145 after they support this we will enable user to disable auto gzip.
vxfield commentedon Apr 16, 2021
For now, what I'm doing is directly downloading the blob using the rest API with a SAS key.
Potential workaround
Full example
Pre-reqs
azure-storage-blobpackage (I tested with version 12.1.0)AZURE_STORAGE_CONNECTION_STRINGenvironment variable with your connection stringCreate file
sample.pyRun
Expected result
The sample program will:
Azure Blob Storage v12.1.0 Uploading to Azure Storage as blob: d99d6a73-5a81-4ef8-8549-d1f66185ef17.gzip Downloading from Azure Storage blob: d99d6a73-5a81-4ef8-8549-d1f66185ef17.gzip Downloading: ./data/d99d6a73-5a81-4ef8-8549-d1f66185ef17.DOWNLOAD.gzip Bytes: 15273869 4194304 [27.46%] 8388608 [54.92%] 12582912 [82.38%] 15273869 [100.00%] Zip MD5 : 7936bf8e5676c5efc4fbcff341657168 Downloaded Zip MD5: 7936bf8e5676c5efc4fbcff341657168 Zip MD5s are equal Txt MD5 : 2e30277eddd3c679dd9482378a9541f5 Downloaded Txt MD5: 2e30277eddd3c679dd9482378a9541f5 Txt MD5s are equal