Reputation: 21
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
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