Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.48k stars 4.81k forks source link

Add BlobBatch ability to delete individual blob snapshots #44602

Closed yuradz closed 3 months ago

yuradz commented 5 months ago

Library name

Azure.Storage.Blobs.Batch

Please describe the feature.

BlobBatch provide the ability to specify DeleteSnapshotsOption (remove blob and all its snapshots, remove only all blob snapshots, or remove only blob). Still, it misses the ability to remove the individual snapshots. It would help to reduce the number of requests.

Additional info: Snapshot removal is almost the same as the removal of the blob itself, but with specifying the additional parameter in the url ?snapshot=value. Azure.Storage.Blobs.BlobRestClient allows to pass it from outside

https://github.com/Azure/azure-sdk-for-net/blob/a509f6f2cb37386526bcbb1189c4b1bb8c3690e3/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs#L440-L443

but Azure.Storage.Blobs.Batch.BlobRestClient doesn't allow it. spanshot value is stored in the field and is never provided by BlobBatch

https://github.com/Azure/azure-sdk-for-net/blob/a509f6f2cb37386526bcbb1189c4b1bb8c3690e3/sdk/storage/Azure.Storage.Blobs.Batch/src/Generated/BlobRestClient.cs#L167-L170

https://github.com/Azure/azure-sdk-for-net/blob/35ae1fae893d3c1678b67595634117dee0f2401d/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatch.cs#L115-L119

github-actions[bot] commented 5 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

seanmcc-msft commented 3 months ago

@yuradz, you can delete individual blob snapshots using the Azure.Storage.Blobs package.