Huby03
Huby03

Reputation: 801

Zip a container with Azure Storage

I am working on a Azure Cloud Service project in Visual Studio. I am using the local storage development. I have created many containers and I've been able to upload some file in those containers. What i need is to Zip a container contents in another container name for example "archive". This is my code:

public string ZipContainer(){
// Connect to the storage account's blob endpoint 
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("BlobConnectionString"));
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

// Create the blob storage container 
CloudBlobContainer container = blobClient.GetContainerReference("archive");
container.CreateIfNotExists(); }

Upvotes: 1

Views: 784

Answers (1)

Michael B
Michael B

Reputation: 12228

The primary reason that Azure Storage is as cheap as it is is because there is very little intelligence built into the solution.

A blob in Azure storage is simply a collection of bits and bytes between two boundaries. It is designed to have the absolute minimum of processor overheard. It is data dumped to disk with a link that encapsulates it.

Compressing data is a comparatively expensive process, and as such it would greatly increase the complexity and cost of storage. (which is a metric that most people will use to judge Azure against its competitors)

TL;DR

There is no way to compress data within Azure storage. You would need to download the data, compress it and then upload it again.

Upvotes: 3

Related Questions