Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob batch delete not working on azurite #2509

Open
ftreede opened this issue Nov 28, 2024 · 1 comment
Open

Blob batch delete not working on azurite #2509

ftreede opened this issue Nov 28, 2024 · 1 comment

Comments

@ftreede
Copy link

ftreede commented Nov 28, 2024

Which service(blob, file, queue, table) does this issue concern?

Blob Storage

Which version of the Azurite was used?

3.33.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

NPM

What's the Node.js version?

20.13.1

What problem was encountered?

Trying to perform a batch delete against azurite does not work, raising this error:

com.azure.storage.blob.models.BlobStorageException: InvalidInput
	at com.azure.storage.blob.batch.BlobBatchHelper.lambda$mapBatchResponse$0(BlobBatchHelper.java:99)

Running the same code against a Azure Blob proper works.

Seems to be the same issue as #2309 .

Steps to reproduce

Sample code:

import com.azure.core.util.BinaryData;
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobContainerClientBuilder;
import com.azure.storage.blob.batch.BlobBatch;
import com.azure.storage.blob.batch.BlobBatchClient;
import com.azure.storage.blob.batch.BlobBatchClientBuilder;

public class AzuriteBatchDeleteTest {
    public static void main(String[] args) {
        BlobContainerClient client = new BlobContainerClientBuilder() //
                .connectionString(<connection string>) //
                .containerName("test") //
                .buildClient();

        // make sure the container exists
        if (!client.exists()) {
            client.create();
        }
        System.out.println("Container created");

        client.getBlobClient("test1").upload(BinaryData.fromString("test1"));
        client.getBlobClient("test2").upload(BinaryData.fromString("test2"));

        System.out.println("Blobs created");


        // delete all blobs
        BlobBatchClient blobBatchClient = new BlobBatchClientBuilder(client)
                .buildClient();

        BlobBatch batch = blobBatchClient.getBlobBatch();
        batch.deleteBlob(client.getBlobContainerName(), "test1");
        batch.deleteBlob(client.getBlobContainerName(), "test2");
        blobBatchClient.submitBatch(batch);

        System.out.println("Blobs deleted");
    }
}

Azurite debug.log output: debug.log

@reinseth
Copy link

Can confirm, I'm seeing the same error with the latest Azurite image in combination with batch sdk version 12.25.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants