Append files to a zip inside azure storage container

Mani 0 Reputation points

I have a requirement to write multiple files into azure blob as a zip, files may come any time of the day. I need to append new files to the existing zip file inside the blob.

One option I explored is downloading the existing zip, decompressing, and then compressing with the new file but I feel this is not an ideal scenario.

Is there an option in Azure where we can write files to the same zip without having to download it.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,094 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 10,420 Reputation points

    Appending files directly to an existing ZIP file stored in an Azure Blob Storage container isn't natively supported by Azure Blob Storage.

    Alternative approaches

    • Azure Blob Storage supports append blobs, which are designed for append operations. While this doesn't directly allow appending to a ZIP file, it does provide a way to append data to a blob. Append blobs are similar to block blobs but are optimized for append operations, making them suitable for scenarios like logging data. However, this method would require a different approach to file storage and management, as it doesn't work with ZIP files directly,logging%20data%20from%20virtual%20machines,%E3%80%9013%E2%80%A0AppendBlockAsync%E3%80%91

    • Another approach is to use Azure Functions, which can be triggered by events (like a file upload) to perform operations on blobs. This could involve downloading the existing ZIP, adding new files, and re-uploading it. While this approach requires downloading and re-uploading the ZIP file, it can be fully automated using Azure Functions.
    0 comments No comments