question

SimonOfHH avatar image
0 Votes"
SimonOfHH asked Sumarigo-MSFT commented

Azure Storage Services REST API; Blob Batch; DELETE Operation "One of the request inputs is not valid"

Hi all,

I'm having trouble using the "Blob Batch"-operation of the Blob Service REST API. I tried a lot with the REST Client for VS Code but can't get it to work. Can you help?

I tried out the C# example from here to make sure, that the operation on the account works this way (which it does)

 // Get a connection string to our Azure Storage account.
 string connectionString = ""BlobEndpoint=https://<myaccount>.blob.core.windows.net/;QueueEndpoint=https://<myaccount>.queue.core.windows.net/;FileEndpoint=https://<myaccount>.file.core.windows.net/;TableEndpoint=https://<myaccount>.table.core.windows.net/;SharedAccessSignature=sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2022-01-03T18:22:05Z&st=2021-01-02T10:22:05Z&spr=https&sig=z1Sdb7mKy7RWep0bbMFw9omoponD6iosvyrlfwJE%2BwI%3D";";
 string containerName = "sample-container";
    
 // Get a reference to a container named "sample-container" and then create it
 BlobServiceClient service = new BlobServiceClient(connectionString);
 BlobContainerClient container = service.GetBlobContainerClient(containerName);
 container.Create();
    
 // Create three blobs named "foo", "bar", and "baz"
 BlobClient foo = container.GetBlobClient("foo");
 BlobClient bar = container.GetBlobClient("bar");
 BlobClient baz = container.GetBlobClient("baz");
 foo.Upload(new MemoryStream(Encoding.UTF8.GetBytes("Foo!")));
 bar.Upload(new MemoryStream(Encoding.UTF8.GetBytes("Bar!")));
 baz.Upload(new MemoryStream(Encoding.UTF8.GetBytes("Baz!")));
    
 // Delete all three blobs at once
 BlobBatchClient batch = service.GetBlobBatchClient();
 batch.DeleteBlobs(new Uri[] { foo.Uri, bar.Uri, baz.Uri });

I then captured the request with Fiddler Everywhere, which returned something like this

 POST https://<myaccount>.blob.core.windows.net/?sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2022-01-03T18:22:05Z&st=2021-01-02T10:22:05Z&spr=https&sig=z1Sdb7mKy7RWep0bbMFw9omoponD6iosvyrlfwJE%2BwI%3D&comp=batch HTTP/1.1
 Host: <myaccount>.blob.core.windows.net
 x-ms-version: 2020-02-10
 x-ms-client-request-id: 04dc79e6-ea49-4f69-96b7-6068834d0c7e
 x-ms-return-client-request-id: true
 User-Agent: azsdk-net-Storage.Blobs/12.7.0 (.NET Core 3.1.1; Microsoft Windows 10.0.19042)
 Content-Length: 1410
 Content-Type: multipart/mixed; boundary=batch_275688cb-ff20-5a51-b98b-7eda33c7a8fc
    
 --batch_275688cb-ff20-5a51-b98b-7eda33c7a8fc
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 Content-ID: 0
    
 DELETE /sample-container3/foo?sv=2019-12-12&ss=bfqt&srt=sco&spr=https&st=2021-01-02T10%3A22%3A05Z&se=2022-01-03T18%3A22%3A05Z&sp=rwdlacuptfx&sig=z1Sdb7mKy7RWep0bbMFw9omoponD6iosvyrlfwJE%2BwI%3D HTTP/1.1
 x-ms-client-request-id: 146cb67e-6e16-46ef-a870-834ac05d0704
 x-ms-return-client-request-id: true
 Content-Length: 0
    
 --batch_275688cb-ff20-5a51-b98b-7eda33c7a8fc
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 Content-ID: 1
    
 DELETE /sample-container3/bar?sv=2019-12-12&ss=bfqt&srt=sco&spr=https&st=2021-01-02T10%3A22%3A05Z&se=2022-01-03T18%3A22%3A05Z&sp=rwdlacuptfx&sig=z1Sdb7mKy7RWep0bbMFw9omoponD6iosvyrlfwJE%2BwI%3D HTTP/1.1
 x-ms-client-request-id: 37a0af7f-9c84-482e-a70c-1bf1b6ed2a38
 x-ms-return-client-request-id: true
 Content-Length: 0
    
 --batch_275688cb-ff20-5a51-b98b-7eda33c7a8fc
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 Content-ID: 2
    
 DELETE /sample-container3/baz?sv=2019-12-12&ss=bfqt&srt=sco&spr=https&st=2021-01-02T10%3A22%3A05Z&se=2022-01-03T18%3A22%3A05Z&sp=rwdlacuptfx&sig=z1Sdb7mKy7RWep0bbMFw9omoponD6iosvyrlfwJE%2BwI%3D HTTP/1.1
 x-ms-client-request-id: 15bd4ed6-24be-53e2-8071-e18264b1ca30
 x-ms-return-client-request-id: true
 Content-Length: 0
    
 --batch_275688cb-ff20-5a51-b98b-7eda33c7a8fc--

I then tried to execute basically the same (only with "sample-container3" instead of "sample-container2") within VS Code, but whatever I try, I receive a "HTTP 202 Accepted" as the "main status", but a "HTTP 400 One of the request inputs is not valid." as the batch response:

 HTTP/1.1 202 Accepted
 Transfer-Encoding: chunked
 Content-Type: multipart/mixed; boundary=batchresponse_1a182dda-7a4c-46aa-a9b8-aa8cfb469b16
 Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
 x-ms-request-id: 04690b42-801e-003c-6fbf-e16890000000
 x-ms-version: 2020-02-10
 x-ms-client-request-id: 04dc79e6-ea49-4f69-96b7-6068834d0c7e
 Date: Sun, 03 Jan 2021 10:59:37 GMT
 Connection: close
    
 --batchresponse_1a182dda-7a4c-46aa-a9b8-aa8cfb469b16
 Content-Type: application/http
    
 HTTP/1.1 400 One of the request inputs is not valid.
 x-ms-error-code: InvalidInput
 x-ms-request-id: 04690b42-801e-003c-6fbf-e16890000000
 x-ms-version: 2020-02-10
 x-ms-client-request-id: 04dc79e6-ea49-4f69-96b7-6068834d0c7e
 Content-Length: 221
 Content-Type: application/xml
 Server: Windows-Azure-Blob/1.0
    
 <?xml version="1.0" encoding="utf-8"?>
 <Error><Code>InvalidInput</Code><Message>One of the request inputs is not valid.
 RequestId:04690b42-801e-003c-6fbf-e16890000000
 Time:2021-01-03T10:59:38.0731174Z</Message></Error>
 --batchresponse_1a182dda-7a4c-46aa-a9b8-aa8cfb469b16--

Any idea what I'm doing wrong? I also already tried it with Shared Key-auth, with only one request in the batch, with different header-combinations... But whatever I try: I get the "202 Accepted" plus the "400 One of the request inputs is not valid".

Thanks in advance for your help!
Cheers
Simon






azure-storage-accounts
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SimonOfHH Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. Based on the error message InvalidInput "Bad Request (400) One of the request inputs is not valid." 400 Error means there's something wrong with the value of one of your properties. Taking a wild guess Check the date/time properties.
I wish to engage with you offline for a closer look and provide quick and specialized assistance, please send an email with subject line “Attn:subm” to AzCommunity[at]Microsoft[dot]com referencing this thread and the Azure subscription ID, I will follow-up with you. Once again, apologies for any inconvenience with this issue.
Thanks for your patience and co-operation.



[1]: https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api

0 Votes 0 ·

Hi @Sumarigo-MSFT, thanks for getting back on this. I've sent you a mail yesterday with the necessary info.

0 Votes 0 ·

Any updates?

0 Votes 0 ·

Have you got any solution to this? Actually, I am getting the same issue.
@SimonOfHH
@Sumarigo-MSFT

0 Votes 0 ·
Sumarigo-MSFT avatar image Sumarigo-MSFT TanishkaArora-5963 ·

@TanishkaArora-5963 May I know what exactly are you facing the issue ? Can you please create a New thread with the detailed information of your query(with the screenshot the error)

Thanks!

0 Votes 0 ·

0 Answers