Microsoft Azure Developer Associate AZ-204 Practice Question

You are developing a .NET 6 worker service that uploads log files to an Azure Blob Storage container by using the Azure.Storage.Blobs SDK (v12). Every uploaded blob must meet these requirements:

  • The Content-Type header must be set to "text/plain" so that browsers render the file correctly when it is downloaded.
  • A custom metadata key named "department" must store the originating department code so that you can later filter blobs by that value. You also want to minimize the number of write transactions that are billed. Which code approach should you use to meet all the requirements?
  • Call BlobClient.UploadAsync(stream, new BlobUploadOptions { HttpHeaders = new BlobHttpHeaders , Metadata = new Dictionary<string,string> { ["department"] = deptCode } });

  • Upload the blob with overwrite set to true, then call BlobClient.SetTagsAsync(new Dictionary<string,string> { ["department"] = deptCode, ["Content-Type"] = "text/plain" });

  • Upload the blob, then call BlobClient.SetHttpHeadersAsync(new BlobHttpHeaders ) followed by BlobClient.SetMetadataAsync(new Dictionary<string,string> { ["department"] = deptCode });

  • Open a writable stream by using BlobClient.OpenWrite(overwrite:true, new BlobOpenWriteOptions { HttpHeaders = new BlobHttpHeaders }) and write the content; metadata is added automatically.

Microsoft Azure Developer Associate AZ-204
Develop for Azure storage
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot