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 ...


Microsoft AZ-204 Exam

Questions Number: 119 out of 355 Questions
33.52%

Question 119
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:
AZ-204_119Q.png related to the Microsoft AZ-204 Exam



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





Previous Questions Next Questions