exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 3 question 31 discussion

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

HOTSPOT -
An organization deploys a blob storage account. Users take multiple snapshots of the blob storage account over time.
You need to delete all snapshots of the blob storage account. You must not delete the blob storage account itself.
How should you complete the code segment? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: DeleteSnapshotsOption -
Sample code in powershell:
//dont forget to add the include snapshots :)
await batchClient.DeleteBlobsAsync(listofURIforBlobs,
Azure.Storage.Blobs.Models.DeleteSnapshotsOption.IncludeSnapshots);
Sample code in .Net:
// Create a batch with three deletes
BlobBatchClient batchClient = service.GetBlobBatchClient();
BlobBatch batch = batchClient.CreateBatch();
batch.DeleteBlob(foo.Uri, DeleteSnapshotsOption.IncludeSnapshots); batch.DeleteBlob(bar.Uri, DeleteSnapshotsOption.OnlySnapshots); batch.DeleteBlob(baz.Uri);
// Submit the batch
batchClient.SubmitBatch(batch);

Box 2: OnlySnapshots -
Reference:
https://docs.microsoft.com/en-us/dotnet/api/overview/azure/storage.blobs.batch-readme https://stackoverflow.com/questions/39471212/programmatically-delete-azure-blob-storage-objects-in-bulks

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
coffecold
Highly Voted 2 years, 4 months ago
it is DeleteSnapshotsOption.OnlySnapshots but the explanation in the answer is bogus as usual. see https://learn.microsoft.com/en-us/dotnet/api/azure.storage.blobs.models.deletesnapshotsoption?view=azure-dotnet
upvoted 20 times
micro9000
2 years, 3 months ago
Yeah, we can ignore the explanation on this one, We can use OnlySnapshots
upvoted 3 times
...
...
Esward
Highly Voted 2 years ago
It was there in 13 Feb 2023 exam
upvoted 7 times
...
J_obando13
Most Recent 3 months ago
Got this in the exam today! May 15, 2025. Went most voted. 940/1000. 50 of 51 from examtopics. Cases Munson’s Pickles and Preserves Farm (7) and Fourth Coffee (3)
upvoted 1 times
...
harbox
11 months ago
Is correct, https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-delete public static async Task DeleteBlobSnapshotsAsync(BlobClient blob) { // Delete a blob and all of its snapshots await blob.DeleteAsync(snapshotsOption: DeleteSnapshotsOption.IncludeSnapshots); // Delete only the blob's snapshots //await blob.DeleteAsync(snapshotsOption: DeleteSnapshotsOption.OnlySnapshots); }
upvoted 3 times
...
Vukile
1 year, 3 months ago
On exam 9 Nov 2023, went with given answer, socre 865. Case Study: Farmers and Distributors
upvoted 2 times
chsiri
1 year, 1 month ago
Where can I find the case studies on this site.
upvoted 1 times
Ciupaz
1 year ago
Now is present.
upvoted 1 times
...
...
...
Pulk
1 year, 3 months ago
correct.
upvoted 1 times
...
MysticalSam
1 year, 8 months ago
This question was in today's exam on 10-June-2023
upvoted 2 times
...
Esward
2 years ago
Given options are correct https://learn.microsoft.com/en-us/dotnet/api/azure.storage.blobs.models.deletesnapshotsoption?view=azure-dotnet
upvoted 1 times
...
OPT_001122
2 years, 2 months ago
DeleteSnapshotsOption.OnlySnapshots
upvoted 4 times
...
finnishr
2 years, 5 months ago
Correct!!
upvoted 5 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 ...