BlobPurge 0.1.1-alpha

This is a prerelease version of BlobPurge.
dotnet tool install --global BlobPurge --version 0.1.1-alpha
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local BlobPurge --version 0.1.1-alpha
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=BlobPurge&version=0.1.1-alpha&prerelease
nuke :add-package BlobPurge --version 0.1.1-alpha

Azure Storage Blob Purge tool

Sometimes our best ideas come back to bite us. In some cases that's our wallet. Have you been collecting data from a service for a long time, but maybe forgot to turn off the collection, then you get a huge bill for your storage account? This tool is here to help.

Getting started

  1. Required: .NET 6.0 SDK
  2. Clone the repo
  3. Explore the tool with dotnet blobpurge -h
Usage - BlobPurge <AccountName> <ContainerName> -options

GlobalOption                       Description
Help (-h, -?, --help)              Shows Help
AccountName* (-a, --account)       The name of the storage account from which to purge blobs
ContainerName* (-c, --container)   The name of the container within the storage account from which to purge blobs
Prefix (-p, --prefix)              The prefix match to use for purging blobs
AgeDays (-d, --days)               The max age of a blob before it is purged
SubscriptionId (-s)                The Subscription ID in which the Storage Account lives, otherwise will use your default subscription (see az account list)
ChunkSize (--chunksize)            The number of blobs to process in parallel [Default='10']
Confirm (-y, --confirm)            Don't prompt for confirmation before starting deletion
WhatIf (--whatif)                  Doesn't actually purge but rather lists the blobs that *would be* purged if the tool were ran without --whatif
Verbose (-v, --verbose)            Outputs more detailed messages as the tool executes

I suggest using --whatif when you're testing your Prefix (-p) or Age (-d) filters as this will ensure no deletes actually get executed.

This tool will use your Azure CLI, Visual Studio, or other interactive credentials if they're found on your system, else (I think?) it'll prompt you for creds and use those. If the account you're after isn't in your default subscription, you can specify its subscription ID with -s


Deleting blobs is an irreversible operation, especially if you don't have Soft Delete turned on in your storage account/container. USE ACCORDINGLY

Good luck & enjoy!

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.1.1-alpha 112 11/3/2022
0.1.0-alpha 105 11/1/2022

Initial release