You are developing a C# application that updates the metadata and changes the access tier of an existing blob using the `Azure.Storage.Blobs` SDK. The blob is currently protected by an active write lease. You also need to retrieve the updated metadata to verify the changes.
Which two actions must you perform? (Select two.)
- Provide the active lease ID within a `BlobRequestConditions` object passed to the metadata and access tier update methods.Answer
- Reference the metadata keys using lowercase strings when reading them from the retrieved `Metadata` dictionary.Answer
- CPrefix the metadata keys with `x-ms-meta-` when adding them to the C# dictionary passed to the SDK method.
- DAcquire a separate, dedicated metadata lease before updating, as write leases only protect the blob's binary content.
- EAuthenticate the request using a Shared Access Signature (SAS) token with Write permissions to bypass the lease constraint.
Answer
Provide the active lease ID within a BlobRequestConditions object, and reference the metadata keys using lowercase strings when reading them from the retrieved Metadata dictionary.
Updating a leased blob's metadata and access tier requires providing the active lease ID in the request conditions. Additionally, because the Azure Blob Storage service converts all metadata keys to lowercase on the server, you must retrieve them using lowercase keys to avoid key lookup errors.
Step-by-Step Solution
Key Concept
Concurrency management with blob leases and case-insensitivity behavior of blob metadata in the Azure SDK.