If two or more metadata headers with the same name are submitted for a resource would the blob service return 200 or 400?

adarsh sharma 21 Reputation points
2022-01-31T01:36:17.603+00:00

According to
https://zcusa.951200.xyz/en-us/learn/modules/work-azure-blob-storage/5-set-retrieve-properties-metadata-rest -

If two or more metadata headers with the same name are submitted for a resource, the Blob service returns status code 400 (Bad Request).

But According to
https://zcusa.951200.xyz/en-us/learn/modules/work-azure-blob-storage/4-manage-container-properties-metadata-dotnet -

If two or more metadata headers with the same name are submitted for a resource, Blob storage comma-separates and concatenates the two values and return HTTP response code 200 (OK).

Well, Which is it?

Am I tripping?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,029 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 37,836 Reputation points Microsoft Employee
    2022-01-31T18:50:51.253+00:00

    @adarsh sharma
    If using the REST API it will return 400 (Bad Request). If using .NET SDK it will comma-separate and concatenate and return 200 (OK).

    Hope this helps to clarify.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Hootan Farokhi 0 Reputation points
    2024-12-27T18:46:43.72+00:00

    The SetMetadata function resets the metadata before setting new values, meaning that it doesn't do an update. The parameter for the metadata is a dictionary, and dictionaries don't allow for duplicate keys. So how can a duplicate metadata field ever be applied using the .NET SDK?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.