[BUG] Blob Batch doesn't work with a SAS token
See original GitHub issueDescribe the bug Failed to delete multiple blobs using the Blob Batch API. (This doesn’t work using the REST API as well)
Expected behavior Successfully deleting the requested blobs
Actual behavior (include Exception or Stack Trace) Exception:
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:dc375805-401e-000a-4717-22235b000000
Time:2020-05-04T13:22:52.7605123Z
Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
ErrorCode: AuthenticationFailed
Additional Information:
AuthenticationErrorDetail: Signature did not match. String to sign used was racwdl
2020-05-10T13:19:15Z
/blob/xxxxxxxxxxxx/$root
c147e641-9806-49d7-9768-3dd744dc1033
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
2020-05-04T13:09:15Z
2020-05-10T13:19:15Z
b
2019-07-07
2019-07-07
c
Headers:
Server: Windows-Azure-Blob/1.0,Microsoft-HTTPAPI/2.0
x-ms-error-code: AuthenticationFailed
x-ms-request-id: dc375805-401e-000a-4717-22235b000000
x-ms-version: 2019-07-07
x-ms-client-request-id: 05d893ad-3666-4d87-83c1-8491a1bf6177
Date: Mon, 04 May 2020 13:22:51 GMT
Content-Length: 628
Content-Type: application/xml
To Reproduce
var service = new BlobServiceClient(new Uri(sasUrl));
var container = service.GetBlobContainerClient("sample-container");
// Create three blobs named "foo", "bar", and "baz"
var foo = container.GetBlobClient("shared/db1/foo");
var bar = container.GetBlobClient("shared/db1/bar");
var baz = container.GetBlobClient("shared/db1/baz");
await foo.UploadAsync(new MemoryStream(Encoding.UTF8.GetBytes("Foo!")));
await bar.UploadAsync(new MemoryStream(Encoding.UTF8.GetBytes("Bar!")));
await baz.UploadAsync(new MemoryStream(Encoding.UTF8.GetBytes("Baz!")));
// Delete all three blobs at once
var batch = service.GetBlobBatchClient();
await batch.DeleteBlobsAsync(new Uri[] { foo.Uri, bar.Uri, baz.Uri });
Environment:
- Azure.Storage.Blobs.Batch 12.2.1
- Windows 10, .NET Core 3.1
- Visual Studio 2019 16.5.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Azure CLI and SAS Token issue in PowerShell
We have ran the same az storage blob upload-batch cmdlet in our local environment( which is running with powershell v5.1) & we are...
Read more >Blob Batch (REST API) - Azure Storage
The Blob Batch operation allows multiple API calls to be embedded into a single HTTP request. This API supports two types of subrequests: ......
Read more >Azure Blob Storage fails to authenticate: "Make sure the ...
Hi I am trying to upload a binary file (a blob for an excel file, actually) to my storage account but the client...
Read more >Configuring an Azure Container for Loading Data
Step 1: Generate the SAS Token¶ · Log into the Azure portal. · From the home dashboard, choose Storage Accounts » <storage_account>. ·...
Read more >AZcopy not working with .bat files : r/AZURE
This doesn't work. I just get an error that reads "azcopy is not recognized as an internal command, operable program or batch file....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think it will. I have a PR in an internal repro updating https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch to mention that only Account SAS is supported.
Will it be supported in the future? If not, can this be added in your docs (https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch)?