Microsoft Azure Developer Associate AZ-204 Practice Question
You are developing a .NET 6 worker service that uploads files to Azure Blob Storage by using the Azure.Storage.Blobs SDK (v12). Each uploaded blob must be stored with the content type set to "application/pdf" and a metadata pair of department=finance. To reduce latency, you must accomplish this in the fewest possible network calls. Which approach should you implement?
Stage the content with StageBlockAsync, then commit with CommitBlockListAsync while passing metadata and headers in the commit call.
Call BlobClient.UploadAsync(stream, new BlobUploadOptions { HttpHeaders = new BlobHttpHeaders , Metadata = new Dictionary<string,string>{{"department","finance"}} });
Call BlobClient.UploadAsync(stream) and then immediately invoke SetMetadataAsync(new Dictionary<string,string>{{"department","finance"}}).
Call BlobClient.UploadAsync(stream) followed by SetHttpHeadersAsync(new BlobHttpHeaders ).
Passing a BlobUploadOptions object to BlobClient.UploadAsync allows you to specify both BlobHttpHeaders (for the Content-Type) and the Metadata collection. The SDK sends these values together with the PUT Blob request, so the blob is created with the required headers and metadata in a single round-trip. Calling UploadAsync followed by either SetMetadataAsync or SetHttpHeadersAsync requires a second request, and using the block-upload pattern shown sends two separate operations (StageBlock plus CommitBlockList) as well as additional round-trips, so they do not meet the "fewest possible calls" requirement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the Azure.Storage.Blobs SDK used for?
Open an interactive chat with Bash
What is the purpose of BlobUploadOptions in the BlobClient.UploadAsync method?
Open an interactive chat with Bash
Why is reducing network calls important in Azure Blob Storage operations?
Open an interactive chat with Bash
Microsoft Azure Developer Associate AZ-204
Develop for Azure storage
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .