I am attempting to download a large file via Azure-python-sdk get_blob_to_stream, however, my program keeps exiting with the return code 137 - which seems to be related to running out of memory. (I can see in top that python is consuming more and more memory until it is killed).
Code:
with io.open(file_path, 'w') as file:
self.blob_service.get_blob_to_stream(container_name='container', blob_name=blob_name, stream=file)
I am using azure-sdk-for-python and get_blob_to_stream for this and the file is about 6.5 gb.
The file is being created as 0 bytes and nothing is written to it - am I doing something obviously wrong here?
In order to download an Azure BLOB Storage item by its URL, you need to instantiate a CloudBlockBlob yourself using the item's URL: var blob = new CloudBlockBlob(new Uri(pdfFileUrl), cloudStorageAccount. Credentials); This blob can then be downloaded with the code you originally posted.
The BlobClient allows you to manipulate Azure Storage blobs.
After downloading the SDK and walking through the code I found out how to get this big blob downloading.
Working code from question example:
with io.open(file_path, 'wb') as file:
self.blob_service.get_blob_to_stream(container_name='wxdata', blob_name=blob_name, stream=file, max_connections=2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With