exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 20 question 1 discussion

Actual exam question from Microsoft's AZ-204
Question #: 1
Topic #: 20
[All AZ-204 Questions]

You need to ensure receipt processing occurs correctly.
What should you do?

  • A. Use blob properties to prevent concurrency problems
  • B. Use blob SnapshotTime to prevent concurrency problems
  • C. Use blob metadata to prevent concurrency problems
  • D. Use blob leases to prevent concurrency problems
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Arul1705
Highly Voted 3 years, 2 months ago
Answer is D: Use blob leases to prevent concurrency problems
upvoted 61 times
Shion2009
3 years, 2 months ago
I guess this could be a problem with the "Processing" scenario: "Then, an email summary is sent to the user with a link to the processing report. The link to the report must remain valid if the email is forwarded to another user." It seems a lease will only be kept alive for 60 seconds, so it shouldn't be an option.
upvoted 3 times
Bengkel
3 years, 2 months ago
A lease does not lock a file for read operations, just for write and delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. So I guess the effect is the same? https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
upvoted 3 times
...
rdemontis
3 years, 2 months ago
Why should you avoid to use blob lease to guarantee access the blob file from the report link? Generally to give access to a blob from http you use SAS. In the SAS you can specify an expiration datetime according to your need. Blob lease is instead a way just to prevent concurrent access and puts a lock on blob only for write and delete operations. Any other can still view the content but can't modify or delete it. So in my opinion the correct answer is Blob lease. In addition I have found the same question on a udemy course test and the answer is just "Blob Lease". https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
upvoted 4 times
MrZoom
3 years, 2 months ago
Agreed. The question is about the receipt processing. The case states "Concurrent processing of a receipt must be prevented", which can't be done with snapshots and leases are made for this specifically. So answer should be D.
upvoted 5 times
...
...
...
...
Javierzgz
Highly Voted 3 years, 2 months ago
I think it is lease (see this link) https://docs.microsoft.com/en-us/azure/storage/blobs/concurrency-manage?tabs=dotnet
upvoted 11 times
...
kabbas
Most Recent 11 months, 1 week ago
Selected Answer: D
must be lease because if you use snapshot to do the processing another thread could write or update the original which could mean you are actually processing out of date data
upvoted 1 times
...
adilkhan
1 year, 2 months ago
D. Use blob leases to prevent concurrency problems. To prevent concurrent processing of a receipt, we need to ensure that only one instance of the processor can access the receipt file at a given time. Blob leases can be used to implement this mechanism. A blob lease allows an application to acquire a lease on a blob for a specified period, during which no other application can modify the blob. When the lease expires or is released, another application can acquire the lease and modify the blob.
upvoted 3 times
...
AymanAkk
1 year, 5 months ago
Selected Answer: D
The Lease Blob operation creates and manages a lock on a blob for write and delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. In versions prior to 2012-02-12, the lock duration is 60 seconds https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
upvoted 2 times
AymanAkk
1 year, 5 months ago
also this Pessimistic concurrency for blobs To lock a blob for exclusive use, you can acquire a lease on it. When you acquire the lease, you specify the duration of the lease. A finite lease may be valid from between 15 to 60 seconds. A lease can also be infinite, which amounts to an exclusive lock. https://learn.microsoft.com/en-us/azure/storage/blobs/concurrency-manage?tabs=dotnet
upvoted 1 times
...
...
Knightie
1 year, 6 months ago
Selected Answer: B
B is correct, the issue is that one staff sent out the receipt but another staff deleted it. When the customer open, the receipt is gone. Extending the lease only give a limited time to access but it does not retain a snapshot of a copy for the customer to retrieve. So Snapshot is right.
upvoted 1 times
Knightie
1 year, 6 months ago
my bad, lease is right, it's a lock. https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
upvoted 2 times
...
...
OPT_001122
1 year, 6 months ago
Selected Answer: D
D. Use blob leases to prevent concurrency problem
upvoted 1 times
...
gmishra88
1 year, 8 months ago
Sure, BlobLease is an option but that does not require me to read a huge scenario. I wonder what the scenario mean for this question. And I wonder why not A as well because Etag is a "property" !!
upvoted 1 times
...
OlivierPaudex
1 year, 9 months ago
I think this one will close the discussion https://docs.microsoft.com/en-us/azure/storage/blobs/concurrency-manage?tabs=dotnet To lock a blob for exclusive use, you can acquire a lease on it. Answer is D
upvoted 1 times
...
Shotare
1 year, 11 months ago
Selected Answer: D
D is correct, although I have managed to solve such problem in real life using blobs metadata so I am not sure whether C could be correct aswell. But D is safer bet
upvoted 1 times
...
SivajiTheBoss
2 years, 3 months ago
Answer: D. Use blob leases to prevent concurrency problems Reason: To lock a blob for exclusive use, you can acquire a lease on it. When you acquire the lease, you specify the duration of the lease. A finite lease may be valid from between 15 to 60 seconds. Reference: https://docs.microsoft.com/en-us/azure/storage/blobs/concurrency-manage?tabs=dotnet#pessimistic-concurrency-for-blobs
upvoted 2 times
...
massnonn
2 years, 3 months ago
Selected Answer: D
Answer is D
upvoted 3 times
...
vilainchien
2 years, 3 months ago
Selected Answer: D
Use blob leases to prevent concurrency problems
upvoted 2 times
...
leonidn
2 years, 4 months ago
Selected Answer: D
For processing purposes "lease" is the simplest option.
upvoted 2 times
...
PhilLI
2 years, 4 months ago
It's quite vague. Receipts are uploaded to Azure Files. Some people place a file, wait for a while, then delete it, and upload it via the webinterface. Should we cater for this situation as well where duplicates may be introduced? File will be copied to blob by the code, but it is not clear how long it will stay there, and how to prevent rereading the same file. I would either use blob storage events, or timestamps to filter the files to be processed. If there is a risk to read the same file twice (shortly after upload when filtering on timestamp) then a lease seems ok: if you can't acquire the lease then another instance of your code is already working on it.
upvoted 1 times
PhilLI
2 years, 4 months ago
I guess the concurrency is caused by the CRON job every 5 minutes. If processing of the available files takes longer than 5 minutes, concurrency issues may be caused.
upvoted 1 times
...
...
RajMasilamani
2 years, 8 months ago
https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob The answer would be Blob lease. Release, to free the lease if it is no longer needed so that another client may immediately acquire a lease against the blob.
upvoted 1 times
RajMasilamani
2 years, 8 months ago
Answer is D
upvoted 1 times
...
...
rhr
3 years, 1 month ago
Given answer is correct
upvoted 2 times
azurelearner666
2 years, 11 months ago
No, it's not. It's D, use blob leases.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...