Share via


az storage file copy

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Manage file copy operations.

Commands

Name Description Type Status
az storage file copy cancel

Abort an ongoing copy operation.

Core GA
az storage file copy cancel (storage-preview extension)

Abort an ongoing copy operation.

Extension GA
az storage file copy start

Copy a file asynchronously.

Core GA
az storage file copy start (storage-preview extension)

Copy a file asynchronously.

Extension GA
az storage file copy start-batch

Copy multiple files or blobs to a file share.

Core GA
az storage file copy start-batch (storage-preview extension)

Copy multiple files or blobs to a file share.

Extension GA

az storage file copy cancel

Abort an ongoing copy operation.

This will leave a destination file with zero length and full metadata. This will raise an error if the copy operation has already ended.

az storage file copy cancel --copy-id
                            --destination-path
                            --destination-share
                            [--account-key]
                            [--account-name]
                            [--auth-mode {key, login}]
                            [--backup-intent --enable-file-backup-request-intent]
                            [--connection-string]
                            [--disallow-trailing-dot {false, true}]
                            [--file-endpoint]
                            [--sas-token]
                            [--timeout]

Required Parameters

--copy-id

The copy operation to abort. This can be either an ID, or an instance of FileProperties.

--destination-path -p

The path to the file within the file share.

--destination-share -s

Name of the destination share. The share must exist.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

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

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Accepted values: key, login
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Property Value
Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

Property Value
Parameter group: Storage Account Arguments
--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

Property Value
Parameter group: Storage Account Arguments
--sas-token

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

Property Value
Parameter group: Storage Account Arguments
--timeout

Request timeout in seconds. Applies to each call to the service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage file copy cancel (storage-preview extension)

Abort an ongoing copy operation.

This will leave a destination file with zero length and full metadata. This will raise an error if the copy operation has already ended.

az storage file copy cancel --copy-id
                            --destination-path
                            --destination-share
                            [--account-key]
                            [--account-name]
                            [--auth-mode {key, login}]
                            [--backup-intent --enable-file-backup-request-intent]
                            [--connection-string]
                            [--disallow-trailing-dot {false, true}]
                            [--sas-token]
                            [--timeout]

Required Parameters

--copy-id

The copy operation to abort. This can be either an ID, or an instance of FileProperties.

--destination-path -p

The path to the file within the file share.

--destination-share -s

Name of the destination share. The share must exist.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

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

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Accepted values: key, login
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Property Value
Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

Property Value
Parameter group: Storage Account Arguments
--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--sas-token

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

Property Value
Parameter group: Storage Account Arguments
--timeout

Request timeout in seconds. Applies to each call to the service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage file copy start

Copy a file asynchronously.

az storage file copy start --destination-path
                           --destination-share
                           [--account-key]
                           [--account-name]
                           [--auth-mode {key, login}]
                           [--backup-intent --enable-file-backup-request-intent]
                           [--connection-string]
                           [--disallow-source-trailing-dot --disallow-src-trailing {false, true}]
                           [--disallow-trailing-dot {false, true}]
                           [--file-endpoint]
                           [--file-mode]
                           [--file-mode-copy-mode {override, source}]
                           [--file-snapshot]
                           [--group]
                           [--metadata]
                           [--owner]
                           [--owner-copy-mode {override, source}]
                           [--sas-token]
                           [--source-account-key]
                           [--source-account-name]
                           [--source-blob]
                           [--source-container]
                           [--source-path]
                           [--source-sas]
                           [--source-share]
                           [--source-snapshot]
                           [--source-uri]
                           [--timeout]

Examples

Copy a file asynchronously.

az storage file copy start --source-account-name srcaccount --source-account-key 00000000 --source-path <srcpath-to-file> --source-share srcshare --destination-path <destpath-to-file> --destination-share destshare --account-name destaccount --account-key 00000000

Copy a file asynchronously from source uri to destination storage account with sas token.

az storage file copy start --source-uri "https://srcaccount.file.core.windows.net/myshare/mydir/myfile?<sastoken>" --destination-path <destpath-to-file> --destination-share destshare --account-name destaccount --sas-token <destination-sas>

Copy a file asynchronously from file snapshot to destination storage account with sas token.

az storage file copy start --source-account-name srcaccount --source-account-key 00000000 --source-path <srcpath-to-file> --source-share srcshare --file-snapshot "2020-03-02T13:51:54.0000000Z" --destination-path <destpath-to-file> --destination-share destshare --account-name destaccount --sas-token <destination-sas>

Copy a file with the source file-mode, group, owner.

az storage file copy start --source-account-name srcaccount --source-path srcpath --source-share srcshare --destination-path dstpath --destination-share dstshare --owner-copy-mode Source --file-mode-copy-mode Source

Copy a file with the overridden file-mode, group, owner.

az storage file copy start --source-account-name srcaccount --source-path srcpath --source-share srcshare --destination-path dstpath --destination-share dstshare --owner-copy-mode Override --file-mode-copy-mode Override --file-mode rw-rw-rw- --owner 4 --group 5

Required Parameters

--destination-path -p

The path to the file within the file share.

--destination-share -s

Name of the destination share. The share must exist.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

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

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Accepted values: key, login
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Property Value
Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

Property Value
Parameter group: Storage Account Arguments
--disallow-source-trailing-dot --disallow-src-trailing

If true, the trailing dot will be trimmed from the source URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

Property Value
Parameter group: Storage Account Arguments
--file-mode

The mode permissions to be set on the file. Only applicable to NFS Files. Only work together with parameter --file-mode-copy-mode Override. Symbolic (rwxrw-rw-) is supported. The sticky bit is also supported and its represented either by the letter t or T in the final character-place depending on whether the execution bit for the others category is set or unset respectively, absence of t or T indicates sticky bit not set.".

--file-mode-copy-mode

Only applicable to NFS Files. Applicable only when the copy source is a File. Determines the copy behavior of the mode bits of the destination file. If not populated, the destination file will have the default File Mode.

Property Value
Accepted values: override, source
--file-snapshot

The file snapshot for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--group

Only applicable to NFS Files. Only work together with parameter --owner-copy-mode Override. The owner group identifier (GID) to be set on the directory. The default value is 0 (root group).

--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--owner

Only applicable to NFS Files. Only work together with parameter --owner-copy-mode Override. The owner user identifier (UID) to be set on the directory. The default value is 0 (root).

--owner-copy-mode

Only applicable to NFS Files. Applicable only when the copy source is a File. Determines the copy behavior of the owner and group of the destination file. If not populated, the destination file will have the default Owner and Group.

Property Value
Accepted values: override, source
--sas-token

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

Property Value
Parameter group: Storage Account Arguments
--source-account-key

The storage account key of the source blob.

Property Value
Parameter group: Copy Source Arguments
--source-account-name

The storage account name of the source blob.

Property Value
Parameter group: Copy Source Arguments
--source-blob

The blob name for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-container

The container name for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-path

The file path for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-sas

The shared access signature for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-share

The share name for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-snapshot

The blob snapshot for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-uri -u

A URL of up to 2 KB in length that specifies an Azure file or blob. The value should be URL-encoded as it would appear in a request URI. If the source is in another account, the source must either be public or must be authenticated via a shared access signature. If the source is public, no authentication is required. Examples: https://myaccount.file.core.windows.net/myshare/mydir/myfile https://otheraccount.file.core.windows.net/myshare/mydir/myfile?sastoken.

Property Value
Parameter group: Copy Source Arguments
--timeout

Request timeout in seconds. Applies to each call to the service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage file copy start (storage-preview extension)

Copy a file asynchronously.

az storage file copy start --destination-path
                           --destination-share
                           [--account-key]
                           [--account-name]
                           [--auth-mode {key, login}]
                           [--backup-intent --enable-file-backup-request-intent]
                           [--connection-string]
                           [--disallow-source-trailing-dot --disallow-src-trailing {false, true}]
                           [--disallow-trailing-dot {false, true}]
                           [--file-snapshot]
                           [--metadata]
                           [--sas-token]
                           [--source-account-key]
                           [--source-account-name]
                           [--source-blob]
                           [--source-container]
                           [--source-path]
                           [--source-sas]
                           [--source-share]
                           [--source-snapshot]
                           [--source-uri]
                           [--timeout]

Examples

Copy a file asynchronously.

az storage file copy start --source-account-name srcaccount --source-account-key 00000000 --source-path <srcpath-to-file> --source-share srcshare --destination-path <destpath-to-file> --destination-share destshare --account-name destaccount --account-key 00000000

Copy a file asynchronously from source uri to destination storage account with sas token.

az storage file copy start --source-uri "https://srcaccount.file.core.windows.net/myshare/mydir/myfile?<sastoken>" --destination-path <destpath-to-file> --destination-share destshare --account-name destaccount --sas-token <destination-sas>

Copy a file asynchronously from file snapshot to destination storage account with sas token.

az storage file copy start --source-account-name srcaccount --source-account-key 00000000 --source-path <srcpath-to-file> --source-share srcshare --file-snapshot "2020-03-02T13:51:54.0000000Z" --destination-path <destpath-to-file> --destination-share destshare --account-name destaccount --sas-token <destination-sas>

Required Parameters

--destination-path -p

The path to the file within the file share.

--destination-share -s

Name of the destination share. The share must exist.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

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

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Accepted values: key, login
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Property Value
Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

Property Value
Parameter group: Storage Account Arguments
--disallow-source-trailing-dot --disallow-src-trailing

If true, the trailing dot will be trimmed from the source URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--file-snapshot

The file snapshot for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--sas-token

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

Property Value
Parameter group: Storage Account Arguments
--source-account-key

The storage account key of the source blob.

Property Value
Parameter group: Copy Source Arguments
--source-account-name

The storage account name of the source blob.

Property Value
Parameter group: Copy Source Arguments
--source-blob

The blob name for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-container

The container name for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-path

The file path for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-sas

The shared access signature for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-share

The share name for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-snapshot

The blob snapshot for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-uri -u

A URL of up to 2 KB in length that specifies an Azure file or blob. The value should be URL-encoded as it would appear in a request URI. If the source is in another account, the source must either be public or must be authenticated via a shared access signature. If the source is public, no authentication is required. Examples: https://myaccount.file.core.windows.net/myshare/mydir/myfile https://otheraccount.file.core.windows.net/myshare/mydir/myfile?sastoken.

Property Value
Parameter group: Copy Source Arguments
--timeout

Request timeout in seconds. Applies to each call to the service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage file copy start-batch

Copy multiple files or blobs to a file share.

az storage file copy start-batch [--account-key]
                                 [--account-name]
                                 [--connection-string]
                                 [--destination-path]
                                 [--destination-share]
                                 [--disallow-source-trailing-dot --disallow-src-trailing {false, true}]
                                 [--disallow-trailing-dot {false, true}]
                                 [--dryrun]
                                 [--file-endpoint]
                                 [--metadata]
                                 [--pattern]
                                 [--sas-token]
                                 [--source-account-key]
                                 [--source-account-name]
                                 [--source-container]
                                 [--source-sas]
                                 [--source-share]
                                 [--source-uri]
                                 [--timeout]

Examples

Copy all files in a file share to another storage account.

az storage file copy start-batch --source-account-name srcaccount --source-account-key 00000000 --source-share srcshare --destination-path <destpath-to-directory> --destination-share destshare --account-name destaccount --account-key 00000000

Copy all files in a file share to another storage account. with sas token.

az storage file copy start-batch --source-uri "https://srcaccount.file.core.windows.net/myshare?<sastoken>" --destination-path <destpath-to-directory> --destination-share destshare --account-name destaccount --sas-token <destination-sas>

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

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

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Parameter group: Storage Account Arguments
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

Property Value
Parameter group: Storage Account Arguments
--destination-path

The directory where the source data is copied to. If omitted, data is copied to the root directory.

--destination-share

The file share where the source data is copied to.

--disallow-source-trailing-dot --disallow-src-trailing

If true, the trailing dot will be trimmed from the source URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--dryrun

List the files and blobs to be copied. No actual data transfer will occur.

Property Value
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

Property Value
Parameter group: Storage Account Arguments
--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--pattern

The pattern used for globbing files and blobs. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3/library/fnmatch.html.

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

Property Value
Parameter group: Storage Account Arguments
--source-account-key

The account key for the source storage account. If omitted, the active login is used to determine the account key.

Property Value
Parameter group: Copy Source Arguments
--source-account-name

The source storage account to copy the data from. If omitted, the destination account is used.

Property Value
Parameter group: Copy Source Arguments
--source-container

The source container blobs are copied from.

Property Value
Parameter group: Copy Source Arguments
--source-sas

The shared access signature for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-share

The source share files are copied from.

Property Value
Parameter group: Copy Source Arguments
--source-uri

A URI that specifies a the source file share or blob container.

If the source is in another account, the source must either be public or authenticated via a shared access signature.

Property Value
Parameter group: Copy Source Arguments
--timeout

Request timeout in seconds. Applies to each call to the service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage file copy start-batch (storage-preview extension)

Copy multiple files or blobs to a file share.

az storage file copy start-batch [--account-key]
                                 [--account-name]
                                 [--connection-string]
                                 [--destination-path]
                                 [--destination-share]
                                 [--disallow-source-trailing-dot --disallow-src-trailing {false, true}]
                                 [--disallow-trailing-dot {false, true}]
                                 [--dryrun]
                                 [--metadata]
                                 [--pattern]
                                 [--sas-token]
                                 [--source-account-key]
                                 [--source-account-name]
                                 [--source-container]
                                 [--source-sas]
                                 [--source-share]
                                 [--source-uri]
                                 [--timeout]

Examples

Copy all files in a file share to another storage account.

az storage file copy start-batch --source-account-name srcaccount --source-account-key 00000000 --source-share srcshare --destination-path <destpath-to-directory> --destination-share destshare --account-name destaccount --account-key 00000000

Copy all files in a file share to another storage account. with sas token.

az storage file copy start-batch --source-uri "https://srcaccount.file.core.windows.net/myshare?<sastoken>" --destination-path <destpath-to-directory> --destination-share destshare --account-name destaccount --sas-token <destination-sas>

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

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

Property Value
Parameter group: Storage Account Arguments
--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.

Property Value
Parameter group: Storage Account Arguments
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

Property Value
Parameter group: Storage Account Arguments
--destination-path

The directory where the source data is copied to. If omitted, data is copied to the root directory.

--destination-share

The file share where the source data is copied to.

--disallow-source-trailing-dot --disallow-src-trailing

If true, the trailing dot will be trimmed from the source URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Property Value
Default value: False
Accepted values: false, true
--dryrun

List the files and blobs to be copied. No actual data transfer will occur.

Property Value
Default value: False
--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--pattern

The pattern used for globbing files and blobs. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3.7/library/fnmatch.html.

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

Property Value
Parameter group: Storage Account Arguments
--source-account-key

The account key for the source storage account. If omitted, the active login is used to determine the account key.

Property Value
Parameter group: Copy Source Arguments
--source-account-name

The source storage account to copy the data from. If omitted, the destination account is used.

Property Value
Parameter group: Copy Source Arguments
--source-container

The source container blobs are copied from.

Property Value
Parameter group: Copy Source Arguments
--source-sas

The shared access signature for the source storage account.

Property Value
Parameter group: Copy Source Arguments
--source-share

The source share files are copied from.

Property Value
Parameter group: Copy Source Arguments
--source-uri

A URI that specifies a the source file share or blob container.

If the source is in another account, the source must either be public or authenticated via a shared access signature.

Property Value
Parameter group: Copy Source Arguments
--timeout

Request timeout in seconds. Applies to each call to the service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False