Lesson 5 of 5 Azure Storage Accounts

Moving Data with Storage Explorer and AzCopy

This lesson explains the two Microsoft tools for managing and transferring storage data and when to use each.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how Azure Storage Explorer connects to and manages storage.
  • Explain the main AzCopy commands and authentication methods.
  • Choose between Storage Explorer and AzCopy for a data movement task.

Azure Storage Explorer

Azure Storage Explorer is a free, standalone application for Windows, macOS and Linux. It connects to storage by signing in with a Microsoft Entra account (and then uses the user's RBAC data roles or lists keys), or by attaching a single resource with an account name and key, a SAS URL or a connection string. It also connects to the local Azurite emulator.

Storage Explorer browses and manages blob containers, file shares, queues and tables: upload and download files and folders, create containers and shares, change access tiers, manage snapshots, view and undelete soft-deleted blobs, manage blob versions, generate SAS tokens, and manage stored access policies and container access levels. It performs transfers with AzCopy internally. The Storage browser in the Azure portal provides many of these functions in the browser without installation.

True or false

Working in Storage Explorer

Exam skills 2.2.5

Check what Azure Storage Explorer can do and how it connects.

Log in to try this activity Interactive activities are free with an account.

AzCopy

AzCopy v10 is a single executable for scripted, high-performance transfers to, from and between storage accounts, and it is preinstalled in Azure Cloud Shell. It authenticates with Microsoft Entra ID (azcopy login, which needs a data role such as Storage Blob Data Contributor) or with a SAS token appended to each URL. Copies between accounts are server-to-server: data does not flow through the machine running AzCopy. The main commands are shown below.

# Upload a folder recursively, authenticating with a SAS token
azcopy copy "./reports" "https://stcontoso.blob.core.windows.net/archive?<SAS>" --recursive

# Copy a container between accounts (server-to-server)
azcopy copy "https://src.blob.core.windows.net/data?<SAS>" "https://dst.blob.core.windows.net/data?<SAS>" --recursive

# Make the destination match the source, deleting extra files
azcopy sync "./site" "https://stcontoso.blob.core.windows.net/$web?<SAS>" --delete-destination=true

# List and resume jobs
azcopy jobs list
azcopy jobs resume <job-id>

azcopy copy transfers everything specified, azcopy sync compares last-modified times and copies only new or changed files, azcopy remove deletes, and azcopy make creates containers and shares. Options include --include-pattern, --block-blob-tier to set the tier on upload, and --cap-mbps to limit bandwidth. Failed jobs can be resumed with their job ID.

The following diagram shows the command and compares the alternatives.

An unattended nightly upload that mirrors deletions. azcopy sync copies only new and changed files, and --delete-destination=true removes blobs whose files were deleted locally; the job signs in with a managed identity or service principal, or uses a SAS. azcopy copy would transfer everything each night and never delete.
The paths and names are placeholders.
Scenario questions

Which AzCopy command?

Exam skills 2.2.5

Choose the AzCopy command or option for each task.

Log in to try this activity Interactive activities are free with an account.
Worked example

Choosing the tool

Each night, a Windows server must upload new and changed files from a 2 TB folder to a blob container, and files deleted locally must also be deleted from the container. The job must run unattended from Task Scheduler. Which tool and command should you use?

Use AzCopy with azcopy sync and --delete-destination=true, authenticated with a managed identity or service principal (azcopy login --identity) or a SAS. Sync copies only changes and removes extra blobs. azcopy copy would transfer everything each night and not delete removed files, and Storage Explorer is interactive, not suited to unattended jobs.

Check yourself

When AzCopy copies a container between two storage accounts, does the data pass through the machine running AzCopy?

Show answer

No. Copies between accounts are server-to-server.

Exam Tips

Remember for the exam

  • Unattended or scripted transfers: AzCopy. Interactive browsing: Storage Explorer or the portal Storage browser.
  • azcopy sync copies only changes and can delete extra destination files.
  • Copies between accounts are server-to-server.
  • AzCopy with Microsoft Entra ID needs a Storage Blob Data role.