Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)?

like image 281
Michalis Avatar asked Sep 17 '25 12:09

Michalis


2 Answers

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.

like image 156
Perry Skountrianos - MSFT Avatar answered Sep 20 '25 02:09

Perry Skountrianos - MSFT


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.

like image 22
Shane Halloran Avatar answered Sep 20 '25 01:09

Shane Halloran