roune
roune

Reputation: 21

Max length on a SAS of Azure

I have been looking at Azure Storage Documentation but I could not find a way to limit the size of a blob when using a SAS. I can set the duration and the type of it but no the size. Do you know any way?

var sharedAccessPolicy = {
    AccessPolicy: {
        Permissions: azure.BlobUtilities.SharedAccessPermissions.WRITE,
        Start: startDate,
        Expiry: expiryDate
    },
  }

Thank you

Upvotes: 2

Views: 1947

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136256

Shared Access Signature (SAS) does not put any restriction on the blob size. If you create a SAS token with proper permission, user in possession of that SAS can upload a file of any size. You would need to handle this in your application.

What you can do is before the user start uploading the file using SAS, you check the size of the file and decline the request if the file size is more than allowed size.

Upvotes: 3

Related Questions