Chapter 1 · AZ-204: Developing Solutions for Microsoft Azure Develop for Azure Storage

Azure Blob Storage – SDK, Properties and Metadata

20 practice questions · 5 marks weightage

Practice questions

  1. Question 1Q-8F69C3

    An ASP.NET Core application uploads a JPEG to Azure Blob Storage. The application must ensure that browsers and download clients recognize the blob as an image. Which configuration should be used during upload?

    1. A.new BlobUploadOptions { HttpHeaders = new BlobHttpHeaders { ContentType = "image/jpeg" } }
    2. B.new BlobUploadOptions { Metadata = new Dictionary<string, string> { ["ContentType"] = "image/jpeg" } }
    3. C.new BlobUploadOptions { Tags = new Dictionary<string, string> { ["ContentType"] = "image/jpeg" } }
    4. D.new BlobUploadOptions { Conditions = new BlobRequestConditions { IfNoneMatch = ETag.All } }
    See the answer and solution
  2. Question 2Q-6ABE34

    A service needs to read a blob's custom metadata key named department without downloading the blob contents. Which code correctly retrieves the metadata?

    1. A.BlobProperties properties = await blob.GetPropertiesAsync(); string department = properties.Metadata["department"];
    2. B.BlobDownloadResult result = await blob.DownloadContentAsync(); string department = result.Value.Content.ToString();
    3. C.IReadOnlyDictionary<string, string> department = await blob.GetTagsAsync();
    4. D.string department = blob.Uri.Query["department"];
    See the answer and solution
  3. Question 3Q-03CF7D

    A blob already has metadata keys department and retention. A job must add the metadata key reviewed while preserving the existing keys. Which code performs this operation correctly?

    1. A.await blob.SetMetadataAsync(new Dictionary<string, string> { ["reviewed"] = "true" });
    2. B.BlobProperties properties = await blob.GetPropertiesAsync(); var metadata = new Dictionary<string, string>(properties.Metadata); metadata["reviewed"] = "true"; await blob.SetMetadataAsync(metadata);
    3. C.await blob.SetTagsAsync(new Dictionary<string, string> { ["reviewed"] = "true" });
    4. D.await blob.SetHttpHeadersAsync(new BlobHttpHeaders { ContentType = "true" });
    See the answer and solution
  4. Question 4Q-09643D

    A catalog service needs to store an arbitrary business value named department on each blob and also specify the blob's MIME type. Which classification is correct in the Azure Blob Storage .NET SDK?

    1. A.department is custom metadata, while the MIME type is set through BlobHttpHeaders.ContentType.
    2. B.Both department and the MIME type must be stored as custom metadata.
    3. C.department is a blob tag, while the MIME type must be stored in the blob body.
    4. D.department is a system property, while the MIME type is stored as a blob tag.
    See the answer and solution
  5. Question 5Q-356E9B

    A .NET service uploads a JSON document and must set its content type and a custom metadata value during the upload. Which code correctly configures the upload?

    1. A.var options = new BlobUploadOptions { HttpHeaders = new BlobHttpHeaders { ContentType = "application/json" }, Metadata = new Dictionary<string, string> { ["source"] = "orders" } }; await blob.UploadAsync(stream, options);
    2. B.var options = new BlobUploadOptions { Tags = new Dictionary<string, string> { ["ContentType"] = "application/json", ["source"] = "orders" } }; await blob.UploadAsync(stream, options);
    3. C.await blob.SetMetadataAsync(new Dictionary<string, string> { ["ContentType"] = "application/json", ["source"] = "orders" }); await blob.UploadAsync(stream);
    4. D.await blob.UploadAsync(stream, new BlobUploadOptions { Metadata = new Dictionary<string, string> { ["ContentType"] = "application/json", ["source"] = "orders" } });
    See the answer and solution

15 more questions on Azure Blob Storage – SDK, Properties and Metadata

Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed