Question

Difficulty: EasyManage Properties, Metadata, and Access Tiers for Azure Blob Storage

You are developing a C# application that processes documents uploaded to Azure Blob Storage using the Azure SDK for .NET. The application needs to retrieve custom metadata from blobs and update it as processing progress is tracked. Which two of the following statements correctly describe the behavior of blob metadata in this scenario?

  1. Metadata name-value pairs are returned as lowercase keys by the Azure Blob Storage service, regardless of the casing used when they were created.Answer
  2. Metadata is retrieved along with system properties by calling GetPropertiesAsync on a BlobClient instance, which populates the Metadata dictionary property.Answer
  3. C
    Custom metadata keys must be explicitly prefixed with 'x-ms-meta-' when adding them to the Metadata dictionary in the .NET SDK.
  4. D
    To update metadata on a blob that has an active write lease, you can use the standard SetMetadataAsync method without providing the lease ID since metadata is separate from the blob's main content.

Answer

Metadata names are returned in lowercase from Azure Blob Storage, and metadata can be retrieved along with system properties by calling GetPropertiesAsync on a BlobClient instance.
The correct statements describe how custom metadata behaves when queried or manipulated. The Azure Blob Storage service returns all user-defined metadata keys in lowercase due to HTTP header case-insensitivity rules. Additionally, custom metadata is retrieved along with system properties using the GetPropertiesAsync method on the BlobClient, which automatically fills the Metadata dictionary properties on the client side.

Step-by-Step Solution

1
Examine how custom metadata is retrieved in the Azure SDK for .NET.
Calling GetPropertiesAsync on the BlobClient retrieves both system properties and custom metadata, populating the Metadata dictionary.
This is the standard API call to fetch a blob's current properties and metadata without downloading the content.
2
Analyze how casing and naming constraints affect metadata returned by Azure Blob Storage.
The Azure Blob Storage service returns all custom metadata keys in lowercase, even if they were defined with uppercase letters.
Custom metadata is transmitted as HTTP headers, which are case-insensitive, and the service converts keys to lowercase.

Key Concept

Azure Blob Storage custom metadata behaves as case-insensitive HTTP headers that are returned as lowercase keys, and must be updated with active lease IDs if the blob is leased.
Estimated Time:1m 0s
Rate this question