Does the Blob Service API respond with a 200 or a 400 if you try to set two metadata values with the same name? Or does it truly depend on whether you're using the SDK or not?

Richard Carrigan 0 Reputation points
2024-07-23T05:43:23.9666667+00:00

According to https://learn.microsoft.com/training/modules/work-azure-blob-storage/5-manage-container-properties-metadata-dotnet: "Metadata names preserve the case with which they were created, but are case-insensitive when set or read. 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 returns HTTP response code 200 (OK)". However, according to the very next module, https://learn.microsoft.com/training/modules/work-azure-blob-storage/6-set-retrieve-properties-metadata-rest: "Metadata names preserve the case with which they were created, but are case-insensitive when set or read. If two or more metadata headers with the same name are submitted for a resource, the Blob service returns status code 400 (Bad Request)". So my question is, which one is correct? While I do recognize that module 5 is talking about the .NET SDK and module 6 is talking about the REST API, surely that can't make a difference in the response...could it?

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

1 answer

Sort by: Most helpful
  1. Amrinder Singh 5,555 Reputation points Microsoft Employee
    2024-07-23T05:50:56.9933333+00:00

    Hi Richard Carrigan - Thanks for reaching out over Q&A Forum.

    Yes, there appears to be some discrepancy in the 2 links that you had shared from the training module. From the below link, it points that it shall ideally return an error.

    https://learn.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#metadata-names

    Based on the usage mechanism, it should ideally not make a difference as underneath API will be called to make the operation.

    I'll try reviewing it internally once again and shall confirm back on this one.

    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.