Install AzCopy on Linux – Fastest way to copy in Azure

AzCopy is a command-line tool that is used for copying data to and from Azure Storage Blob, File, and Table services, or to and from objects within the same storage account, and even between different storage accounts.

AzCopy is available in two flavors:

  • AzCopy on Windows
  • AzCopy on Linux

There are two versions of AzCopy that you can download. AzCopy on Linux is built with .NET Core Framework, which targets Linux platforms offering POSIX style command-line options. AzCopy on Windows is built with .NET Framework, and offers Windows style command-line options.

This article covers AzCopy on Linux.

Installation on Linux

AzCopy on Linux requires .NET Core framework (version 2.0) on the platform. See the installation instructions below

Install and enable the .NET SDK

After registering with the Subscription Manager and enabling the .NET Core channel, you are ready to install and enable the .NET SDK. In your command prompt, run the following commands:

# yum install rh-dotnet20 -y scl enable rh-dotnet20 bash

Once you have installed .NET Core, download and install AzCopy.

# wget -O azcopy.tar.gz https://aka.ms/downloadazcopyprlinux tar -xf azcopy.tar.gz sudo ./install.sh

You can remove the extracted files once AzCopy on Linux is installed. Alternatively if you do not have superuser privileges, you can also run AzCopy using the shell script ‘azcopy’ in the extracted folder.

The basic syntax for AzCopy commands is:

# azcopy --source  --destination  [Options]

The following examples demonstrate various scenarios for copying data to and from Microsoft Azure Blobs and Files. Refer to the azcopy –help menu for a detailed explanation of the parameters used in each sample.

If any user face issue while running azcopy command which asks for dotnet files, enter the below line in the users .bashrc file.

# source scl_source enable rh-dotnet20

If a user oracle needs to run this command, then add the below line to the oracle .bash_profile under PATH section:

/opt/rh/rh-dotnet20/root/usr/bin/

Add the below line in the script if you would use azcopy in a shell script.

source scl_source enable rh-dotnet20

Now type azcopy in the server and it shows the available options to use, you can explore the options and use this command as required.

Conclusion

AzCopy is a command-line utility for copying data to and from Azure BLOB, file, and table storage with optimal performance. You can copy data from one object to another within or between storage accounts. As Azure Stack behaves in the same way, you can just use the same EXE for running it against itself.

By default, AzCopy will use Internet bandwidth as much as possible, and if we have a large amount of data to transfer, it could be a potential problem. However, if we add the parameter –cap-mbps, we can define upload or download bandwidth.

Related Post