I'm trying to delete file from Azure Storage Account Blob and I'm geting the following error:
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
I'm using SAS Token to authenticate my request;
I can list blobs using:
https://[myaccount].blob.core.windows.net/[mycontainer]/?restype=container&comp=list
I'm succesfully uploading files to my container using powershell and command azcopy, but when i try DELETE request i get error mentioned above.
My request URL looks like:
https://[myaccount].blob.core.windows.net/[mycontainer]/[myfile]?sv=2020-08-04&ss=bfqt&srt=sco&sp=rwdlacupitfx&se=2035-11-17T01:45:55Z&st=2021-11-16T17:45:55Z&spr=https&sig=[mysignature]
The above error occurs when you try with the wrong sas token or you may given the wrong sas parameter you have passed in your SAS-URL.
I tried in my environment and got the below results:
You can get the SAS token with the URL in the portal below:
Portal:
Postman:
The above request was made successfully and deleted the blob successfully in my environment.
Update:
If you need to delete the container level you can get the SAS token from the portal:
Add your container name and file name inside the SAS_URL which you want to delete.
The above request will delete your file by changing your filename.
Reference:
Delete Blob (REST API) - Azure Storage | Microsoft Learn