[BUG] InvalidQueryParameterValue while trying to delete a blob by BlobBatchClient with Storage Emulator
See original GitHub issueLibrary name and version
Azure.Storage.Blobs.Batch 12.10.0
Describe the bug
Unhandled exception. Azure.RequestFailedException: Value for one of the query parameters specified in the request URI is invalid. RequestId:fdaeeccc-bf65-426b-8aee-7d081347db56 Time:2022-09-13T04:15:57.8983848Z Status: 400 (Value for one of the query parameters specified in the request URI is invalid.) ErrorCode: InvalidQueryParameterValue
Additional Information: QueryParameterName: comp QueryParameterValue: batch
Expected behavior
No exception throwed
Actual behavior
Unhandled exception. Azure.RequestFailedException: Value for one of the query parameters specified in the request URI is invalid. RequestId:fdaeeccc-bf65-426b-8aee-7d081347db56 Time:2022-09-13T04:15:57.8983848Z Status: 400 (Value for one of the query parameters specified in the request URI is invalid.) ErrorCode: InvalidQueryParameterValue
Additional Information: QueryParameterName: comp QueryParameterValue: batch Reason:
Content:
<?xml version="1.0" encoding="utf-8"?><Error>InvalidQueryParameterValue
<Message>Value for one of the query parameters specified in the request URI is invalid.
RequestId:fdaeeccc-bf65-426b-8aee-7d081347db56 Time:2022-09-13T04:15:57.8983848Z</Message><QueryParameterName>comp</QueryParameterName><QueryParameterValue>batch</QueryParameterValue><Reason /></Error>
Headers: Server: Microsoft-HTTPAPI/2.0 x-ms-request-id: fdaeeccc-bf65-426b-8aee-7d081347db56 x-ms-error-code: InvalidQueryParameterValue Date: Tue, 13 Sep 2022 04:15:57 GMT Content-Length: 376 Content-Type: application/xml
at Azure.Storage.Blobs.Batch.ServiceRestClient.SubmitBatch(Int64 contentLength, String multipartContentType, Stream body, Nullable1 timeout, CancellationToken cancellationToken) at Azure.Storage.Blobs.Specialized.BlobBatchClient.SubmitBatchInternal(BlobBatch batch, Boolean throwOnAnyFailure, Boolean async, CancellationToken cancellationToken) at Azure.Storage.Blobs.Specialized.BlobBatchClient.DeleteBlobsInteral(IEnumerable
1 blobUris, DeleteSnapshotsOption snapshotsOption, Boolean async, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBatchClient.DeleteBlobs(IEnumerable`1 blobUris, DeleteSnapshotsOption snapshotsOption, CancellationToken cancellationToken)
at Program.<Main>$(String[] args) in D:\Mine\Projects\MyAzureStorage\MyStupidBlobBatch\Program.cs:line 25
Reproduction Steps
Run this code with C# Console
`using Azure.Storage.Blobs; using Azure.Storage.Blobs.Specialized;
var connectionString = “DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;”; var containerName = Guid.NewGuid().ToString() + “-sample-container”;
BlobServiceClient service = new BlobServiceClient(connectionString); BlobContainerClient container = service.GetBlobContainerClient(containerName); container.Create();
BlobClient foo = container.GetBlobClient(“foo”); BlobClient bar = container.GetBlobClient(“bar”); BlobClient baz = container.GetBlobClient(“baz”); foo.Upload(BinaryData.FromString(“Foo!”)); bar.Upload(BinaryData.FromString(“Bar!”)); baz.Upload(BinaryData.FromString(“Baz!”));
// Delete all three blobs at once BlobBatchClient batch = service.GetBlobBatchClient();
try { batch.DeleteBlobs(new Uri[] { foo.Uri, bar.Uri, baz.Uri });
container.Delete();
} catch (AggregateException ex) { container.Delete();
throw ex;
}
Console.ReadLine();`
Environment
Local: Storage Emulator
It does working on my Azure Storage Account
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
@MrFlyingBear We are aware of this issue and its a work in progress. I will be updating this thread once the fix is released soon. If you have any follow-up questions, you may reopen this thread. We would be happy to help. Thanks again for reaching out to us and reporting this issue.
@MrFlyingBear I was discussing this issue with the Azurite product owners and it seems like the latest published Azurite doesn’t support Blob Batch. Blob Batch feature is under development and will release soon.