A simple CLI to mess with Azure blobs.
abc is structured using commands and sub-commands. The command hierarchy is
as follows.
containers- do stuff with containersls- list containers on a storage accountmk- create containers on a storage accountrm- remove containers from a storage account
blobs- do stuff with blobs in containersls- list blobs in a containerrm- remove blobs from a container
You can use the -h on any command to get more information:
abc blobs ls -hAuthentication is attempted automatically according to the options listed in Azure authentication with the Azure Identity module for Go
Running abc is most easy on Azure workloads that have a managed identity
assigned to them (see options 2 and 3 on the page linked above). Using a service
principal with a secret is almost as easy, using the AZURE_CLIENT_ID,
AZURE_TENANT_ID and AZURE_CLIENT_SECRET environment variables (option 1 on
the page linked above).
The following examples assume authentication is taken care of.
abc blobs ls -n mystorageaccount -c mycontainerThis will list each blob on a separate line in the output.
abc blobs rm -n mystorageaccount -c mycontainer $(abc blobs ls -n mystorageaccount -c mycontainer | head -n-3)