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 name (i.e. container name).
The name of directory.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Metadata in space-separated key=value pairs. This overwrites any existing metadata.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 name (i.e. container name).
The name of directory.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage fs directory download
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
The destination local directory path to download.
The download source file system.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Recursively download files. If enabled, all the files including the files in subdirectories will be downloaded.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
The download source directory path. It should be an absolute path to file system.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 name (i.e. container name).
The name of directory.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 name (i.e. container name).
The name of directory.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
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.
Response header value for Cache-Control when resource is accessedusing this shared access signature.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Response header value for Content-Disposition when resource is accessedusing this shared access signature.
Response header value for Content-Encoding when resource is accessedusing this shared access signature.
Response header value for Content-Language when resource is accessedusing this shared access signature.
Response header value for Content-Type when resource is accessedusing this shared access signature.
Specify the encryption scope for a request made so that all write operations will be service encrypted.
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.
Indicate that this command return the full blob URI and the shared access signature token.
Only permit requests made with the HTTPS protocol. If omitted, requests from both the HTTP and HTTPS protocol are permitted.
Specifies the IP address or range of IP addresses from which to accept requests. Supports only IPv4 style addresses.
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.
The name of a stored access policy.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 name (i.e. container name).
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Specify the maximum number of results to return.
Filter the results to return only paths under the specified path.
Look into sub-directories recursively when set to true.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 name (i.e. container name).
The name of directory.
The new directory name the users want to move to. The value must have the following format: "{filesystem}/{directory}/{subdirectory}".
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 name (i.e. container name).
The name of directory.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage fs directory upload
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
The upload destination file system.
The source file path to upload from.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
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.
Recursively upload files. If enabled, all the files including the files in subdirectories will be uploaded.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.