Prepare and test your skills

Prepare and test your skills

Free sample question, answered and explained below. The AZ-204 Developing Solutions for Microsoft Azure Exam practice bank has 1,929 more like it. Try 10 free: instant score, no account.
A development team is building an application that uploads various document types, such as PDFs and images, to Azure Blob Storage. For each uploaded document, they need to ensure that the browser correctly interprets the file type by setting the appropriate Content-Type property. Additionally, they must attach custom information, specifically a ProjectID and DocumentVersion, to each blob for internal tracking and categorization.
The team is using the Azure Blob Storage .NET SDK.
Which of the following approaches should the team use to efficiently set both the standard Content-Type and the custom ProjectID and DocumentVersion for each blob?
While you can store custom data as user-defined metadata, Content-Type is a specific system property that directly impacts how web browsers and applications handle the blob. Storing it as user-defined metadata would prevent it from being recognized as a standard HTTP header, leading to incorrect interpretation of the file type. The documentation clearly separates 'System properties' from 'User-defined metadata,' indicating they are handled differently.
While blob index tags can store key-value attributes for categorization and searching, they are a distinct feature from user-defined metadata. The question specifically asks to attach 'custom information' as 'metadata' for internal tracking. User-defined metadata is designed for this purpose, offering simple key-value pairs that don't affect blob behavior. Blob index tags are primarily for creating a searchable index. The documentation notes: 'Blob index tags also provide the ability to store arbitrary user-defined key/value attributes alongside an Azure Blob storage resource.' This indicates they are an additional way to store attributes, not a replacement for user-defined metadata in this context.
Azure Blob Storage distinguishes between system properties, like Content-Type, which are standard HTTP headers, and user-defined metadata, which are custom key-value pairs. The most efficient and correct approach is to use the .NET SDK's capabilities to set the Content-Type as a system property (e.g., via BlobHttpHeaders) and to set ProjectID and DocumentVersion as user-defined metadata (e.g., via a Dictionary<string, string>). This ensures proper handling by browsers for Content-Type and provides flexible, accessible custom tracking information without affecting blob behavior. The documentation states: 'System properties exist on each Blob storage resource. Some of them can be read or set, while others are read-only. Under the covers, some system properties correspond to certain standard HTTP headers.' and 'User-defined metadata consists of one or more name-value pairs that you specify for a Blob storage resource. You can use metadata to store additional values with the resource.'
Embedding custom tracking information like ProjectID and DocumentVersion directly within the blob's content as JSON is generally inefficient for metadata purposes. This approach would require downloading and parsing the entire blob content to retrieve these values, which is resource-intensive compared to accessing them directly as blob metadata. Azure Blob Storage provides dedicated mechanisms for metadata that are designed for this type of external tracking information. The documentation highlights that 'User-defined metadata consists of one or more name-value pairs that you specify for a Blob storage resource. You can use metadata to store additional values with the resource.'
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated