Installing AzCopy v10 on Linux

There are several versions of the Azure command-line utility, azcopy. The latest (as of this writing) is v10.

If you’re on Linux, getting azcopy v10 installed and adding it to your system’s command-line completion is undocumented (for now) in the above link. Fortunately, we can adapt the Linux installation for the older azcopy v7 to get azcopy v10 installed and added to the system command-line completion. Here’s how.

(Note that v7 uninstallation is also undocumented at this point. If you have an existing installation of azcopy 7, consider uninstalling it before installing v10. Refer to this github issue for details. This will also remove your v7 azcopy from command-line completion.)

Download azcopy v7

Wait – aren’t we installing v10? Yes! However, we’ll adapt files delivered with v7, which are not delivered with v10 and for which no alternate procedure is documented. Don’t worry about dependencies or other installs, we don’t need them for this.

Reference

Execute the following command to download the latest azcopy v7 tarball.

wget -O azcopy_v7.tar.gz https://aka.ms/downloadazcopylinux64

Extract v7

Now execute the following commands to create a new directory and extract the contents of the v7 tarball into that new directory.

mkdir azcopy_v7
tar -xf azcopy_v7.tar.gz -C azcopy_v7

Download azcopy v10

Reference

Next, execute the following command to download the latest azcopy v10 tarball.

wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux

Extract v10

Now execute the following commands to create a new directory and extract the contents of the v10 tarball into that new directory.

mkdir azcopy_v10
tar -xf azcopy_v10.tar.gz -C azcopy_v10

Prep the v10 folder

In order to use the v7 install script unchanged, we need to prepare the v10 folder where we just extracted the v10 tarball. (You don’t need to do this step if you’re comfortable editing the install.sh script used below and adjusting folder/file paths instead.)

We list the contents of the v10 folder to which we extracted the v10 tarball, and see a folder that references the specific version of azcopy v10 and contains the executable.

ls azcopy_v10

We will see a subfolder named similarly to

azcopy_linux_amd64_10.1.2

(the specific version may change after this writing).

We’ll rename this subfolder to just azcopy so that the v7 install script works without changes, using this command.

mv azcopy_v10/azcopy_linux_amd64_10.1.2 azcopy_v10/azcopy

(Adjust this command to your specific subfolder name, if needed.)

Checkpoint

You should now have the following folder structure:

azcopy_v7/
azcopy/* (many files)
install.sh
azcopy_v10/
azcopy/* (few files)

Copy needed v7 files to v10

Let’s copy the files we need from v7 to v10 using the following commands. We need three files: install.sh, azcopy_autocomplete, and startup.

cp azcopy_v7/install.sh azcopy_v10/install.sh
cp azcopy_v7/azcopy/azcopy_autocomplete azcopy_v10/azcopy/
cp azcopy_v7/azcopy/startup azcopy_v10/azcopy/

We can verify that the files copied successfully.

ls -lR azcopy_v10

This should show a folder structure like this:

azcopy_v10/
azcopy/
install.sh
azcopy_v10/azcopy/
azcopy
azcopy_autocomplete
startup

Install

To recap, azcopy v10 by itself needs no installation. The install script from azcopy v7, though, is still useful in order to make azcopy resolve at the command line from any folder on the system.

Currently – if you do not have azcopy installed already or did not uninstall a previous install – you can type azcopy --version and get an error like -bash: /usr/bin/azcopy: No such file or directory. This is not convenient, since we’d like to be able to invoke azcopy from any directory.

The v7 install script and the other files we copied in the previous step will add azcopy to command completion system-wide.

We’ll use the install script as follows:

sudo ./azcopy_v10/install.sh

After it runs, we can type

azcopy --version

again (from any folder), and this time we should get reasonable output like:

azcopy version 10.1.2

Conclusion

Congratulations – your Linux system is now running azcopy v10. Head to the AzCopy v10 Docs to get started.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s