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

Viewed 79

According to https://docs.microsoft.com/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://docs.microsoft.com/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 missing something?

1 Answers

Actually both of them are true.

The first one is for the REST API operation. If you are calling the REST API directly and setting 2 metadata items with the same name, the request will fail with bad request (400 status code error).

The second one is for when you are using .Net SDK. Here, if you are setting 2 metadata items with the same name, the SDK will combine both of them and send a single header request to the REST API.

Related