Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.17k stars 4.53k forks source link

[BUG] GetProperties method does not return metadata even thougvh the summary says so #44822

Closed Eneuman closed 1 day ago

Eneuman commented 4 days ago

Library name and version

Azure.Storage.Blobs 12.20.0

Describe the bug

When calling the GetPropertiesAsync method as described in the help: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-properties-metadata

the method does not return any metadata even though the method summary says so: https://github.com/Azure/azure-sdk-for-net/blob/d4ab17567700c1af5c361298d77b27f99d52f3a4/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs#L280

This is because theese lines:

https://github.com/Azure/azure-sdk-for-net/blob/d4ab17567700c1af5c361298d77b27f99d52f3a4/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs#L315-L326

does not include the required parameter comp=metadata as described in the REST documentation here: https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob-metadata?tabs=microsoft-entra-id

I suggest adding a separat API for metadata or add a trait.

Expected behavior

Metadata would be returned

Actual behavior

No metadata is returned

Reproduction Steps

Use the code in the help page here: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-properties-metadata and try to retrive user metadata.

Section Set and retrieve metadata

Environment

N/A

github-actions[bot] commented 3 days ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Eneuman commented 1 day ago

Closing this issue becuase I found the problem in my code.