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, 2 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, 1 month ago
Yeah, we can ignore the explanation on this one, We can use OnlySnapshots
upvoted 3 times
...
...
Esward
Highly Voted 1 year, 10 months ago
It was there in 13 Feb 2023 exam
upvoted 7 times
...
J_obando13
Most Recent 4 weeks, 1 day 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
9 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, 1 month ago
On exam 9 Nov 2023, went with given answer, socre 865. Case Study: Farmers and Distributors
upvoted 2 times
chsiri
11 months, 1 week ago
Where can I find the case studies on this site.
upvoted 1 times
Ciupaz
10 months, 4 weeks ago
Now is present.
upvoted 1 times
...
...
...
Pulk
1 year, 1 month ago
correct.
upvoted 1 times
...
MysticalSam
1 year, 6 months ago
This question was in today's exam on 10-June-2023
upvoted 2 times
...
[Removed]
1 year, 8 months ago
Got this in exam today (5 April 2023)
upvoted 4 times
...
Esward
1 year, 10 months 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 ago
DeleteSnapshotsOption.OnlySnapshots
upvoted 4 times
...
finnishr
2 years, 3 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 ...