Soenneker.Blob.Delete
4.0.3116
Prefix Reserved
dotnet add package Soenneker.Blob.Delete --version 4.0.3116
NuGet\Install-Package Soenneker.Blob.Delete -Version 4.0.3116
<PackageReference Include="Soenneker.Blob.Delete" Version="4.0.3116" />
<PackageVersion Include="Soenneker.Blob.Delete" Version="4.0.3116" />
<PackageReference Include="Soenneker.Blob.Delete" />
paket add Soenneker.Blob.Delete --version 4.0.3116
#r "nuget: Soenneker.Blob.Delete, 4.0.3116"
#:package Soenneker.Blob.Delete@4.0.3116
#addin nuget:?package=Soenneker.Blob.Delete&version=4.0.3116
#tool nuget:?package=Soenneker.Blob.Delete&version=4.0.3116
Soenneker.Blob.Delete
Deletes individual Azure blobs, entire containers, or every blob under a virtual-directory prefix.
Install
dotnet add package Soenneker.Blob.Delete
Register the utility in Program.cs:
using Soenneker.Blob.Delete.Registrars;
builder.Services.AddBlobDeleteUtilAsSingleton();
Scoped registration is also available.
The underlying Blob packages require Azure:Storage:Blob:ConnectionString in configuration. Store that value in a secret provider.
Delete one blob
Response<bool> response = await blobDelete.Delete(
"invoices",
"2026/obsolete.pdf",
cancellationToken);
bool deleted = response.Value;
false means the blob did not exist. Azure authorization, lease, snapshot, and service failures throw RequestFailedException. The default Azure delete behavior does not include snapshots, so a blob with snapshots may require explicit snapshot cleanup before this method can delete it.
Delete a virtual directory
Azure Blob Storage has blob-name prefixes rather than physical directories. This method lists the supplied prefix and deletes each returned blob sequentially:
bool allDeleted = await blobDelete.DeleteDirectory(
"exports",
"temporary/2026/",
cancellationToken);
The result is true when every listed blob was deleted or no blobs matched. It is false if a listed blob disappeared before its delete completed. Azure request failures are not converted to false; they stop the operation and propagate.
Prefix matching can include more blobs than intended when the trailing delimiter is omitted. Use temporary/2026/, not temporary/2026, when only that virtual directory should be removed.
Delete a container
bool deleted = await blobDelete.DeleteContainer(
"temporary-exports",
cancellationToken);
Container deletion removes all blobs, versions, and snapshots in that container. Treat the container name as trusted application configuration, not direct user input.
Important behavior
The shared client/container utilities normalize container names to lowercase.
Those utilities ensure the target container exists while resolving clients. As a result, deleting a missing blob or container can briefly create the missing container before deletion. Avoid using these methods as existence probes.
Directory deletion is not transactional. Cancellation or a failure can leave a partially deleted prefix.
Soft delete, versioning, immutability policies, legal holds, and leases can change whether data is recoverable or whether deletion is allowed.
Cancellation stops pending work; it does not undo work that has already completed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Blob.Client (>= 4.0.2230)
- Soenneker.Blob.Fetch (>= 4.0.2407)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blob.Delete:
| Package | Downloads |
|---|---|
|
Soenneker.Blob.Suite
A concoction of Azure Blob Storage utilities and libraries |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.3116 | 0 | 10/1/2026 |
| 4.0.3115 | 0 | 10/1/2026 |
| 4.0.3114 | 50 | 9/30/2026 |
| 4.0.3113 | 60 | 9/30/2026 |
| 4.0.3112 | 46 | 9/30/2026 |
| 4.0.3111 | 80 | 9/29/2026 |
| 4.0.3110 | 66 | 9/29/2026 |
| 4.0.3109 | 107 | 9/29/2026 |
| 4.0.3108 | 64 | 9/29/2026 |
| 4.0.3107 | 247 | 9/25/2026 |
| 4.0.3106 | 107 | 9/25/2026 |
| 4.0.3105 | 96 | 9/25/2026 |
| 4.0.3104 | 110 | 9/25/2026 |
| 4.0.3103 | 95 | 9/25/2026 |
| 4.0.3102 | 103 | 9/25/2026 |
| 4.0.3101 | 125 | 9/25/2026 |
| 4.0.3100 | 95 | 9/25/2026 |
| 4.0.3098 | 108 | 9/24/2026 |
| 4.0.3097 | 87 | 9/24/2026 |
| 4.0.3096 | 328 | 9/17/2026 |
Updated Soenneker.Blob.Fetch to 4.0.2407