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?
- 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
- Metadata is retrieved along with system properties by calling GetPropertiesAsync on a BlobClient instance, which populates the Metadata dictionary property.Answer
- CCustom metadata keys must be explicitly prefixed with 'x-ms-meta-' when adding them to the Metadata dictionary in the .NET SDK.
- DTo 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
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