serge
serge

Reputation: 15229

Can GET, can't DELETE - Azure Blobs

I have an application that manages Attachments associated to a Post. I need to GET and also DELETE them.

The attachments are grouped in Azure Blob Containers (a container per Post). I try to use the Azure API to delete it, but it says does not found (404).

enter image description here

but the DELETE does not work

enter image description here

Here are another HTTP Headers from localhost:

enter image description here

Upvotes: 0

Views: 654

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136196

The reason you're getting this error is because a Delete Blob request can't be anonymous (a Get Blob request can be anonymous depending on the blob container's ACL).

What you would need to do is either create an Authorization request header and include that in the request (which is not recommended considering you're making an AJAX call and you would have to expose your account key on the client side for that) or use a Shared Access Signature (SAS) URL with Delete permission included in the SAS.

Upvotes: 2

Related Questions