Guillaume
Guillaume

Reputation: 13128

How to limit the size of an azure blob container?

In my application, a web service send a shared access signature (write rights on container) to the client so it can upload files.

Is there any way to limit the size (1Gb for instance) of uploaded content ? The ideal solution would be a custom size limit on the container. Otherwise it could be a limit on the shared access signature.

I could also change my application to send a share access signature on individual blobs if the feature is available on blobs.

Upvotes: 6

Views: 23179

Answers (3)

Adrien Constant
Adrien Constant

Reputation: 341

The concept of trusting the client over the date size to be sent is pretty dangerous, especially for a service that bills depending on the size of the data transferred and stored.

The client could be a public HTML website. Any user who could leak the SAS by calling your service, would be able to send an enormous file.

I think the SAS should specify the maximum size of data that can be read, of written, for a given container / BLOB.

Upvotes: 13

Matt Denman
Matt Denman

Reputation: 11

It is typical for someone to have uploads go to the app first, and the app writes the file to the blob itself. The leased signatures is typically used for read only scenarios.

Upvotes: -1

Gaurav Mantri
Gaurav Mantri

Reputation: 136126

Windows Azure does not provide limit per container. The limit provided by Windows Azure is by storage account (100 TB/account) and by individual blob (200 GB max. for a block blob and 1 TB max. for a page blob). For your requirement, I think you would need to implement this limit in your application.

Upvotes: 20

Related Questions