Use AzCopy to Transfer Data from One Storage Account to Another

1 hour
  • 4 Learning Objectives

About this Hands-on Lab

In the scenario for this hands-on lab, you are a storage administrator. The Data Science department needs you to migrate the data from one of their storage accounts to a new storage account with hierarchical namespaces. They are using _Azure HD Insight_ and need the big data analytics capabilities that come with _Gen 2 Data Lake Storage_. Use the AzCopy tool within Azure Cloud Shell to perform the migration.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Storage Container
  1. Login to the Azure Portal, open Cloud Shell and get to a bash prompt.
  2. List the available storage accounts within the lab environment.
  3. List the storage account keys for each storage account for proper permission to create the container.
  4. Within the first storage account (begins with stor1), perform the command to create a container named container1.
Use AzCopy to Transfer Data to the Container
  1. Within the Azure CLI, generate the SAS token necessary to give azcopy access to the storage account.
  2. Use azcopy in the command-line to copy the data from your local drive, to the storage account beginning with stor1.
Create a Second Storage Container
  1. From the Azure CLI, perform the command to create a container named container2 within the second storage account (begins with stor2).
Copy Data between Storage Accounts using AZCOPY
  • Within the Azure CLI, generate the SAS token necessary to give azcopy access to the storage account
  • Use azcopy in the command-line to copy the data from the first storage account (begins with stor1) to the second storage account (begins with stor2)
  • Verify that the data resides within container2

Additional Resources

The two storage accounts have already been provisioned for this hands-on lab. Start up a bash prompt inside Azure Cloud Shell. You will need to populate the data in the first storage account (starts with stor1) using the following command:

  # generate multiple files at once
  for i in {000..100}
  do
    echo hello > "File${i}.txt"
  done

When you've generated the data, create a new container inside the first storage account (starts with stor1), and copy the data into the storage container using azcopy.

Once you've verified that the data exists within the first storage account, create a storage container in the second storage account (starts with stor2), and copy the data from one account to the other.

You will have completed this hands-on lab when you have verified all of the data now exists in the second storage account.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?