Michalis
Michalis

Reputation: 543

Upload multiple files in Azure Blob Storage from Linux

Is there a way to upload multiple files to Azure Blob Storage from a Linux machine, either using the terminal or an application (web based or not)?

Upvotes: 4

Views: 4865

Answers (3)

Shane Halloran
Shane Halloran

Reputation: 328

You can use the find command with the exec option to execute the command to upload each file, as described here as described here:

find *.csv -exec az storage blob upload --file {} --container-name \
CONTAINER_NAME --name {} --connection-string=‘CONNECTION_STRING’ \;

where CONNECTION_STRING is the connection string of your Azure Blob store container, available from portal.azure.com. This will upload all CSV files in your directory to the Azure Blob store associated with the connection string.

Upvotes: 1

fpark
fpark

Reputation: 2369

If you prefer the commandline and have a recent Python interpreter, the Azure Batch and HPC team has released a code sample with some AzCopy-like functionality on Python called blobxfer. This allows full recursive directory ingress into Azure Storage as well as full container copy back out to local storage. [full disclosure: I'm a contributor for this code]

Upvotes: 0

Thank you for your interest – There are two options to upload files in Azure Blobs from Linux:

  1. Setup and use XPlatCLI by following the steps below:

    • Install the OS X Installer from http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/
    • Open a Terminal window and connect to your Azure subscription by either downloading and using a publish settings file or by logging in to Azure using an organizational account (find instructions here)
    • Create an environment variable AZURE_STORAGE_CONNECTION_STRING and set its value (you will need your account name and account key): “DefaultEndpointsProtocol=https;AccountName=enter_your_account;AccountKey=enter_your_key”
    • Upload a file into Azure blob storage by using the following command: azure storage blob upload [file] [container] [blob]
  2. Use one of the third party web azure storage explorers like CloudPortam: http://www.cloudportam.com/. You can find the full list of azure storage explorers here: http://blogs.msdn.com/b/windowsazurestorage/archive/2014/03/11/windows-azure-storage-explorers-2014.aspx.

Upvotes: 2

Related Questions