'Azure Blob copy folder from one container to another after zipping it
Inside a blob storage I have two containers Source and Target. I need to copy the folders from Source to target but one condition is that the folders need to be zipped before I copy them into the Target container. I am using Python. I have managed to copy the folders but I haven't been able to find a way to zip them.
blob_service_client = BlobServiceClient(account_url='https://blob_storage.blob.core.windows.net/',credential='access_key')
source_container_name = "Source"
source_file_path = "1644579641903/data_0_0_0.csv"
source_blob = f"https://blob_storage.blob.core.windows.net/{source_container_name}/{source_file_path}"
target_container_name = "Target"
target_file_path = "1644579641903/data_0_0_0.csv"
copied_blob = blob_service_client.get_blob_client(target_container_name, target_file_path)
copied_blob.start_copy_from_url(source_blob)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
