Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

getMetadata returns only nulls #589

Closed
MichaelVonB opened this issue Feb 22, 2024 · 1 comment
Closed

getMetadata returns only nulls #589

MichaelVonB opened this issue Feb 22, 2024 · 1 comment

Comments

@MichaelVonB
Copy link

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

BlobStorage

Which version of the SDK was used?

azure-storage-blob-12.25.1

What problem was encountered?

We upload blob with metaData

BlobParallelUploadOptions options =
            new BlobParallelUploadOptions(byteArrayInputStream)
                .setRequestConditions(new BlobRequestConditions().setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD)) // sets overwrite files to false
                .setMetadata(Map.of("foo", "bar"))
                .setHeaders(jsonHeaders);

blobClient.uploadWithResponse(options, null, Context.NONE);

and query them later on essentially like this

BlobContainerClient blobContainerClient = blobServiceClient.getBlobContainerClient("my-blob-container-client");
List<Map<String, String>> metaDataList = blobContainerClient.listBlobs().stream()
            .map(BlobItem::getMetadata)
            .toList();

But this will be a List of nulls. However I can see in the azure portal that the meta data is filled.

Have you found a mitigation/solution?

This works but I would expect the other solution to work aswell

List<Map<String, String>> metaDataListFull = blobContainerClient.listBlobs().stream()
            .map(it -> blobContainerClient.getBlobClient(it.getName()))
            .map(it -> it.getProperties().getMetadata())
            .toList();
@MichaelVonB
Copy link
Author

This was the wrong place. Created an issue at the right repo. See
Azure/azure-sdk-for-java#38913

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

No branches or pull requests

1 participant