azurekit is a CLI toolkit to interact with microsoft azure blob storage. There are several commands included.
- azruecat - Output a blob content to stdout.
- azuresink - Pipe stdin to a azure storage blob.
- azuresas - Generate the Shared-Access-Signature to stdout.
- azuretbl2csv - Dump azure table as csv file.
- azuretbl2json - Dump azure table as json file.
Java 8
-
First, you must prepare your Connection String for your storage account. The format is
DefaultEndpointsProtocol=[http|https];AccountName=myAccountName;AccountKey=myAccountKey
-
Download from release.
-
Run the commands.
Usage
-
Print a resource
azurecat https://<account-name>.blob.core.windows.net/<container-name>/<blob-path>
-
Concatenate and print the resources with prefix
azurecat --prefix https://<account-name>.blob.core.windows.net/<container-name>/<blob-prefix>
-
Concatenate and print the resources with prefix and the resource should match the postfix
azurecat --prefix --postfix csv https://<account-name>.blob.core.windows.net/<container-name>/<blob-prefix>
-
Decode the resource by gzip compression format.
azurecat -z --prefix --postfix gz https://<account-name>.blob.core.windows.net/<container-name>/<blob-prefix>
The full help for azurecat
usage: azurecat [-c <connection-string>] <blob-uri>
-b <arg> Set the read buffer size in KBytes
-c <arg> The connection string
-h The help information
--postfix <string> keep only the blob which has the path with the
specified postfix. The postfix only be used while
prefix is used.
--prefix cat all the blobs with the prefix
-v The version
-z The gzip format
Usage
- Upload the content 'helloword' to the given path
echo 'helloworld' | azuresink -c <connection-string> http://<account-name>.blob.core.windows.net/<container-name>/<blob-path>
The full help for azuresink
usage: azuresink [-c <connection-string>] <blob-uri>
-c <arg> The connection string
-f Force upload even the blob exists
-h The help information
-v The version
Usage
- Get the SAS url with 1 day expiration duration.
azuresas -c <connection-string> http://<account-name>.blob.core.windows.net/<container-name>/<blob-path>
The full help for azuresas
usage: azuresas [-c <connection-string>] -e <seconds> <blob-uri>
-c <arg> The connection string
-e <arg> The seconds to expired. (default=86400s)
-h The help information
-v The version
Usage
-
Dump a table
azuretbl2csv -c <connection-string> https://<account-name>.table.core.windows.net/<table-name> azuretbl2json -c <connection-string> https://<account-name>.table.core.windows.net/<table-name>
-
Select some columns
azuretbl2json -C "column1,column2" https://<account-name>.table.core.windows.net/<table-name>
-
Apply filter
azuretbl2json -f "(PartitionKey eq 'pk1' and RowKey eq 'rk1')" https://<account-name>.table.core.windows.net/<table-name>
The full help for azuretbl2json
usage: azuretbl2json [-c <connection-string>] <table-url>
-c <arg> The connection string
-C <arg> The selected columns
-f <arg> The filter string
-H,--no-header-row Do not output column names.
-t <arg> The take count. Default=1000
You can put your connection strings at ~/.azure/storagekeys
line by line
Here is the example.
DefaultEndpointsProtocol=https;AccountName=myAccountName1;AccountKey=myAccountKey1
DefaultEndpointsProtocol=https;AccountName=myAccountName2;AccountKey=myAccountKey2
then, you can use the resource directly without connection string specified.
echo 'helloworld' | azurecat https://<account-name>.blob.core.windows.net/<container-name>/<blob-path>
Install azurekit via Homebrew.
brew tap tenmax/tap
brew update
brew install azurekit
Upgrade azurekit
brew update
brew upgrade azurekit
Run azurekit via Docker.
docker run --rm -it tenmax/azurekit