Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

Uploading large file (> 256MB) using HTTP client from python, without using Azure SDK #676

Open akshayDhotre opened 3 years ago

akshayDhotre commented 3 years ago

Which service(blob, file, queue) does this issue concern?

Azure Blob storge

Which version of the SDK was used? Please provide the output of pip freeze.

NA

What problem was encountered?

Not able to upload large file (> 256MB) to azure blob storage with HTTP client on Azure Blob SAS URL

xiafu-msft commented 3 years ago

Hi @akshayDhotre

Thanks for reaching out. It looks like this is not correct repo for your question. While can you explain a bit about "on Azure Blob SAS URL" so we can see if there's anything we can help.

virtual-deepak commented 3 years ago

@xiafu-msft To elaborate on @akshayDhotre 's question -

Please let us know if you need any more information

xiafu-msft commented 3 years ago

Hi @deeagar

You can install azure-storage-blob version 12.3.2 and use the upload_blob api. https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.3.2/azure.storage.blob.html#azure.storage.blob.BlobClient.upload_blob

huzefaqubbawala commented 3 years ago

I think the question title states that we need to do this without using azure sdk. Currently it is possible using azure blob sdk or calling azure blob storage REST API but the case here is different.

Consider you are building a independent service and the service does not know whether its going to write on azure blob storage or amazon or google or any file server http path.

The service is responsible for creating a zip and uploading it to the destination path provided by the user. The destination path can be any valid URI with write permission.

To make solution generic we have used httpclient to post that file. The limitation of 256MB is holding back for larger files. I see only two way we can solve this problem -

  1. Increase the size limit from 256MB to configurable size
  2. Partial upload using httpClient

Point 2 - Partial upload seems to be not possible, below stackoverflow link regarding the same https://stackoverflow.com/questions/20969331/standard-method-for-http-partial-upload-resume-upload

xiafu-msft commented 3 years ago

Hi @deeagar

If you are using service version 2019-12-12, the max put size is 5GB. Can you try that and let us know if that works?