Κοινή χρήση μέσω


az storage fs directory

Manage directories in Azure Data Lake Storage Gen2 account.

Commands

Name Description Type Status
az storage fs directory create

Create a directory in ADLS Gen2 file system.

Core GA
az storage fs directory delete

Delete a directory in ADLS Gen2 file system.

Core GA
az storage fs directory download

Download files from the directory in ADLS Gen2 file system to a local file path.

Core Preview
az storage fs directory exists

Check for the existence of a directory in ADLS Gen2 file system.

Core GA
az storage fs directory generate-sas

Generate a SAS token for directory in ADLS Gen2 account.

Core GA
az storage fs directory list

List directories in ADLS Gen2 file system.

Core GA
az storage fs directory metadata

Manage the metadata for directory in file system.

Core GA
az storage fs directory metadata show

Return all user-defined metadata for the specified directory.

Core GA
az storage fs directory metadata update

Sets one or more user-defined name-value pairs for the specified file system.

Core GA
az storage fs directory move

Move a directory in ADLS Gen2 file system.

Core GA
az storage fs directory show

Show properties of a directory in ADLS Gen2 file system.

Core GA
az storage fs directory upload

Upload files or subdirectories to a directory in ADLS Gen2 file system.

Core Preview

az storage fs directory create

Create a directory in ADLS Gen2 file system.

az storage fs directory create --file-system
                               --name
                               [--account-key]
                               [--account-name]
                               [--auth-mode {key, login}]
                               [--blob-endpoint]
                               [--connection-string]
                               [--metadata]
                               [--permissions]
                               [--sas-token]
                               [--timeout]
                               [--umask]

Examples

Create a directory in ADLS Gen2 file system.

az storage fs directory create -n dir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Create a directory in ADLS Gen2 file system through connection string.

az storage fs directory create -n dir -f myfilesystem --connection-string myconnectionstring

Required Parameters

--file-system -f

File system name (i.e. container name).

--name -n

The name of directory.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--blob-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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--metadata

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

--permissions

POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read (4), write (2), or execute (1) permission. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. The sticky bit is also supported and in symbolic notation, 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 (e.g. rwxrw-rw- with sticky bit is represented as rwxrw-rwT. A rwxrw-rwx with sticky bit is represented as rwxrw-rwt), absence of t or T indicates sticky bit not set. In 4-digit octal notation, its represented by 1st digit (e.g. 1766 represents rwxrw-rw- with sticky bit and 0766 represents rwxrw-rw- without sticky bit). For more information, please refer to https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-access-control#levels-of-permission.

--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.

--timeout

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

--umask

When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For more information, please refer to https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-access-control#umask.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory delete

Delete a directory in ADLS Gen2 file system.

az storage fs directory delete --file-system
                               --name
                               [--account-key]
                               [--account-name]
                               [--auth-mode {key, login}]
                               [--blob-endpoint]
                               [--connection-string]
                               [--sas-token]
                               [--timeout]
                               [--yes]

Examples

Delete a directory in ADLS Gen2 file system.

az storage fs directory delete -n dir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Delete a directory in ADLS Gen2 file system. (autogenerated)

az storage fs directory delete --account-name myadlsaccount --auth-mode login --file-system myfilesystem --name dir --yes

Required Parameters

--file-system -f

File system name (i.e. container name).

--name -n

The name of directory.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--blob-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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--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.

--timeout

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

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory download

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Download files from the directory in ADLS Gen2 file system to a local file path.

az storage fs directory download --destination-path
                                 --file-system
                                 [--account-key]
                                 [--account-name]
                                 [--auth-mode {key, login}]
                                 [--connection-string]
                                 [--recursive]
                                 [--sas-token]
                                 [--source-path]

Examples

Download a single file in a directory in ADLS Gen2 file system.

az storage fs directory download -f myfilesystem --account-name mystorageaccount -s "path/to/file" -d "<local-path>"

Download whole ADLS Gen2 file system.

az storage fs directory download -f myfilesystem --account-name mystorageaccount  -d "<local-path>" --recursive

Download the entire directory in ADLS Gen2 file system.

az storage fs directory download -f myfilesystem --account-name mystorageaccount -s SourceDirectoryPath -d "<local-path>" --recursive

Download an entire subdirectory in ADLS Gen2 file system.

az storage fs directory download -f myfilesystem --account-name mystorageaccount -s "path/to/subdirectory" -d "<local-path>" --recursive

Required Parameters

--destination-path -d

The destination local directory path to download.

--file-system -f

The download source file system.

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 files. If enabled, all the files including the files in subdirectories will be downloaded.

--sas-token

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

--source-path -s

The download source directory path. It should be an absolute path to file system.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory exists

Check for the existence of a directory in ADLS Gen2 file system.

az storage fs directory exists --file-system
                               --name
                               [--account-key]
                               [--account-name]
                               [--auth-mode {key, login}]
                               [--blob-endpoint]
                               [--connection-string]
                               [--sas-token]
                               [--timeout]

Examples

Check for the existence of a directory in ADLS Gen2 file system.

az storage fs directory exists -n dir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Check for the existence of a directory in ADLS Gen2 file system. (autogenerated)

az storage fs directory exists --account-name myadlsaccount --auth-mode login --file-system myfilesystem --name dir

Required Parameters

--file-system -f

File system name (i.e. container name).

--name -n

The name of directory.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--blob-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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--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.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory generate-sas

Generate a SAS token for directory in ADLS Gen2 account.

az storage fs directory generate-sas --file-system
                                     --name
                                     [--account-key]
                                     [--account-name]
                                     [--as-user]
                                     [--auth-mode {key, login}]
                                     [--blob-endpoint]
                                     [--cache-control]
                                     [--connection-string]
                                     [--content-disposition]
                                     [--content-encoding]
                                     [--content-language]
                                     [--content-type]
                                     [--encryption-scope]
                                     [--expiry]
                                     [--full-uri]
                                     [--https-only]
                                     [--ip]
                                     [--permissions]
                                     [--policy-name]
                                     [--start]

Examples

Generate a sas token for directory and use it to upload files.

end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage fs directory generate-sas --name dir --file-system myfilesystem --https-only --permissions dlrw --expiry $end -o tsv

Required Parameters

--file-system -f

File system name (i.e. container name).

--name -n

The name of directory.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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.

--as-user

Indicates that this command return the SAS signed with the user delegation key. The expiry parameter and '--auth-mode login' are required if this argument is specified.

Default value: False
--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
--blob-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.

--cache-control

Response header value for Cache-Control when resource is accessedusing this shared access signature.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--content-disposition

Response header value for Content-Disposition when resource is accessedusing this shared access signature.

--content-encoding

Response header value for Content-Encoding when resource is accessedusing this shared access signature.

--content-language

Response header value for Content-Language when resource is accessedusing this shared access signature.

--content-type

Response header value for Content-Type when resource is accessedusing this shared access signature.

--encryption-scope

Specify the encryption scope for a request made so that all write operations will be service encrypted.

--expiry

Specifies the UTC datetime (Y-m-d'T'H:M'Z') at which the SAS becomes invalid. Do not use if a stored access policy is referenced with --policy-name that specifies this value.

--full-uri

Indicate that this command return the full blob URI and the shared access signature token.

Default value: False
--https-only

Only permit requests made with the HTTPS protocol. If omitted, requests from both the HTTP and HTTPS protocol are permitted.

--ip

Specifies the IP address or range of IP addresses from which to accept requests. Supports only IPv4 style addresses.

--permissions

The permissions the SAS grants. Allowed values: (a)dd (c)reate (d)elete (e)xecute (l)ist (m)ove (o)wnership (p)ermissions (r)ead (w)rite. Do not use if a stored access policy is referenced with --id that specifies this value. Can be combined.

--policy-name

The name of a stored access policy.

--start

Specifies the UTC datetime (Y-m-d'T'H:M'Z') at which the SAS becomes valid. Do not use if a stored access policy is referenced with --policy-name that specifies this value. Defaults to the time of the request.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory list

List directories in ADLS Gen2 file system.

az storage fs directory list --file-system
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--blob-endpoint]
                             [--connection-string]
                             [--num-results]
                             [--path]
                             [--recursive {false, true}]
                             [--sas-token]
                             [--timeout]

Examples

List directories in ADLS Gen2 file system.

az storage fs directory list -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

List directories in "dir/" for ADLS Gen2 file system.

az storage fs directory list --path dir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Required Parameters

--file-system -f

File system name (i.e. container name).

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--blob-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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--num-results

Specify the maximum number of results to return.

--path

Filter the results to return only paths under the specified path.

--recursive

Look into sub-directories recursively when set to true.

Accepted values: false, true
Default value: True
--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.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory move

Move a directory in ADLS Gen2 file system.

az storage fs directory move --file-system
                             --name
                             --new-directory
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--blob-endpoint]
                             [--connection-string]
                             [--sas-token]
                             [--timeout]

Examples

Move a directory a directory in ADLS Gen2 file system.

az storage fs directory move --new-directory newfs/dir -n dir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Move a directory in ADLS Gen2 file system. (autogenerated)

az storage fs directory move --account-name myadlsaccount --auth-mode login --file-system myfilesystem --name dir --new-directory newfs/dir

Required Parameters

--file-system -f

File system name (i.e. container name).

--name -n

The name of directory.

--new-directory -d

The new directory name the users want to move to. The value must have the following format: "{filesystem}/{directory}/{subdirectory}".

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--blob-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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--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.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory show

Show properties of a directory in ADLS Gen2 file system.

az storage fs directory show --file-system
                             --name
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--blob-endpoint]
                             [--connection-string]
                             [--sas-token]
                             [--timeout]

Examples

Show properties of a directory in ADLS Gen2 file system.

az storage fs directory show -n dir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Show properties of a subdirectory in ADLS Gen2 file system.

az storage fs directory show -n dir/subdir -f myfilesystem --account-name myadlsaccount --account-key 0000-0000

Show properties of a directory in ADLS Gen2 file system. (autogenerated)

az storage fs directory show --account-name myadlsaccount --auth-mode login --file-system myfilesystem --name dir

Required Parameters

--file-system -f

File system name (i.e. container name).

--name -n

The name of directory.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--blob-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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--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.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az storage fs directory upload

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Upload files or subdirectories to a directory in ADLS Gen2 file system.

az storage fs directory upload --file-system
                               --source
                               [--account-key]
                               [--account-name]
                               [--auth-mode {key, login}]
                               [--connection-string]
                               [--destination-path]
                               [--recursive]
                               [--sas-token]

Examples

Upload a single file to a storage blob directory.

az storage fs directory upload -f myfilesystem --account-name mystorageaccount -s "path/to/file" -d directory

Upload a local directory to root directory in ADLS Gen2 file system.

az storage fs directory upload -f myfilesystem --account-name mystorageaccount -s "path/to/directory" --recursive

Upload a local directory to a directory in ADLS Gen2 file system.

az storage fs directory upload -f myfilesystem --account-name mystorageaccount -s "path/to/directory" -d directory --recursive

Upload a set of files in a local directory to a directory in ADLS Gen2 file system.

az storage fs directory upload -f myfilesystem --account-name mystorageaccount -s "path/to/file*" -d directory --recursive

Required Parameters

--file-system -f

The upload destination file system.

--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-path -d

The upload destination directory path. It should be an absolute path to file system. If the specified destination path does not exist, a new directory path will be created.

--recursive -r

Recursively upload files. If enabled, all the files including the files in subdirectories will be uploaded.

--sas-token

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.