az storage azcopy blob

Manage object storage for unstructured data (blobs) using AzCopy.

Commands

az storage azcopy blob delete

Delete blobs from a storage blob container using AzCopy.

az storage azcopy blob download

Download blobs from a storage blob container using AzCopy.

az storage azcopy blob sync

Sync blobs recursively to a storage blob container using AzCopy.

az storage azcopy blob upload

Upload blobs to a storage blob container using AzCopy.

az storage azcopy blob delete

Delete blobs from a storage blob container using AzCopy.

az storage azcopy blob delete --container
                              [--account-key]
                              [--account-name]
                              [--auth-mode {key, login}]
                              [--connection-string]
                              [--recursive]
                              [--sas-token]
                              [--target]

Examples

Delete a single blob from a container.

az storage azcopy blob delete -c MyContainer --account-name MyStorageAccount -t TargetBlob

Delete all blobs from a container.

az storage azcopy blob delete -c MyContainer --account-name MyStorageAccount --recursive

Delete all blobs in a virtual directory.

az storage azcopy blob delete -c MyContainer --account-name MyStorageAccount -t "path/to/virtual_directory" --recursive

Required Parameters

--container -c

The delete target container.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--recursive -r

Recursively delete blobs.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--target -t

The delete target path.

az storage azcopy blob download

Download blobs from a storage blob container using AzCopy.

az storage azcopy blob download --container
                                --destination
                                [--account-key]
                                [--account-name]
                                [--auth-mode {key, login}]
                                [--connection-string]
                                [--recursive]
                                [--sas-token]
                                [--source]

Examples

Download a single blob from a container.

az storage azcopy blob download -c MyContainer --account-name MyStorageAccount -s "path/to/blob" -d "path/to/file"

Download a virtual directory from a container.

az storage azcopy blob download -c MyContainer --account-name MyStorageAccount -s "path/to/virtual_directory" -d "download/path" --recursive

Download the contents of a container onto a local file system.

az storage azcopy blob download -c MyContainer --account-name MyStorageAccount -s * -d "download/path" --recursive

Required Parameters

--container -c

The download source container.

--destination -d

The destination file path to download to.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--recursive -r

Recursively download blobs.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--source -s

The download source path.

az storage azcopy blob sync

Sync blobs recursively to a storage blob container using AzCopy.

az storage azcopy blob sync --container
                            --source
                            [--account-key]
                            [--account-name]
                            [--auth-mode {key, login}]
                            [--connection-string]
                            [--destination]
                            [--sas-token]

Examples

Sync a single blob to a container.

az storage azcopy blob sync -c MyContainer --account-name MyStorageAccount -s "path/to/file" -d NewBlob

Sync a directory to a container.

az storage azcopy blob sync -c MyContainer --account-name MyStorageAccount -s "path/to/directory"

Required Parameters

--container -c

The sync destination container.

--source -s

The source file path to sync from.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--destination -d

The sync destination path.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

az storage azcopy blob upload

Upload blobs to a storage blob container using AzCopy.

az storage azcopy blob upload --container
                              --source
                              [--account-key]
                              [--account-name]
                              [--auth-mode {key, login}]
                              [--connection-string]
                              [--destination]
                              [--recursive]
                              [--sas-token]

Examples

Upload a single blob to a container.

az storage azcopy blob upload -c MyContainer --account-name MyStorageAccount -s "path/to/file" -d NewBlob

Upload a directory to a container.

az storage azcopy blob upload -c MyContainer --account-name MyStorageAccount -s "path/to/directory" --recursive

Upload the contents of a directory to a container.

az storage azcopy blob upload -c MyContainer --account-name MyStorageAccount -s "path/to/directory/*" --recursive

Required Parameters

--container -c

The upload destination container.

--source -s

The source file path to upload from.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--destination -d

The upload destination path.

--recursive -r

Recursively upload blobs.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.