Microsoft Azure Developer Associate AZ-204 Practice Question
In a .NET 6 worker service you must download a blob from Azure Storage only when the object has changed since the previous run. The last successful synchronization persisted the blob's ETag. Using the Azure.Storage.Blobs client library, which approach should you implement to prevent unnecessary data transfer without an extra round-trip to the service?
Set BlobClientOptions.TransferValidation to MatchETag before creating the BlobClient.
Call GetPropertiesAsync, compare the stored ETag locally, and only then invoke DownloadToAsync if the tags differ.
Pass a BlobRequestConditions instance with IfNoneMatch set to the stored ETag when calling DownloadStreamingAsync.
Append ?if-none-match= to the blob URL and call DownloadToAsync.
The Azure Storage REST API supports conditional requests that are executed in a single round-trip. In the .NET client library you express these conditions through a BlobRequestConditions object. By setting IfNoneMatch to the previously stored ETag and passing that instance to DownloadStreamingAsync (or DownloadToAsync), the service returns the blob only when the ETag no longer matches. If the tag is unchanged the call completes with an HTTP 304 response and no content is sent, eliminating redundant data transfer. The other options are incorrect because:
TransferValidation is not a valid setting in BlobClientOptions.
Manually calling GetPropertiesAsync first adds an extra network request that the conditional download avoids.
Adding an if-none-match query string is not recognized by the storage service; conditional headers must be supplied through request conditions.
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 an ETag in Azure Storage?
Open an interactive chat with Bash
What is BlobRequestConditions used for?
Open an interactive chat with Bash
What happens during an HTTP 304 response for a blob in Azure?
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 .