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.
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
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
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.
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
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.
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
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
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.
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" !!
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
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
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
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.
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.
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.
This section is not available anymore. Please use the main Exam Page.AZ-204 Exam Questions
Log in to ExamTopics
Sign in:
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.
Arul1705
Highly Voted 3 years, 2 months agoShion2009
3 years, 2 months agoBengkel
3 years, 2 months agordemontis
3 years, 2 months agoMrZoom
3 years, 2 months agoJavierzgz
Highly Voted 3 years, 2 months agokabbas
Most Recent 11 months, 1 week agoadilkhan
1 year, 2 months agoAymanAkk
1 year, 5 months agoAymanAkk
1 year, 5 months agoKnightie
1 year, 6 months agoKnightie
1 year, 6 months agoOPT_001122
1 year, 6 months agogmishra88
1 year, 8 months agoOlivierPaudex
1 year, 9 months agoShotare
1 year, 11 months agoSivajiTheBoss
2 years, 3 months agomassnonn
2 years, 3 months agovilainchien
2 years, 3 months agoleonidn
2 years, 4 months agoPhilLI
2 years, 4 months agoPhilLI
2 years, 4 months agoRajMasilamani
2 years, 8 months agoRajMasilamani
2 years, 8 months agorhr
3 years, 1 month agoazurelearner666
2 years, 11 months ago