az storage fs directory

Manage directories in Azure Data Lake Storage Gen2 account.

Commands

az storage fs directory create

Create a directory in ADLS Gen2 file system.

az storage fs directory delete

Delete a directory in ADLS Gen2 file system.

az storage fs directory exists

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

az storage fs directory list

List directories in ADLS Gen2 file system.

az storage fs directory metadata

Manage the metadata for directory in file system.

az storage fs directory metadata show

Return all user-defined metadata for the specified directory.

az storage fs directory metadata update

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

az storage fs directory move

Move a directory in ADLS Gen2 file system.

az storage fs directory show

Show properties of a directory in ADLS Gen2 file system.

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}]
                               [--connection-string]
                               [--metadata]
                               [--permissions]
                               [--sas-token]
                               [--subscription]
                               [--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.

--name -n

The name of directory.

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.

--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, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. For more information, please refer to https://docs.microsoft.com/en-us/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. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

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

--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/en-us/azure/storage/blobs/data-lake-storage-access-control#umask.

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}]
                               [--connection-string]
                               [--sas-token]
                               [--subscription]
                               [--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

Required Parameters

--file-system -f

File system name.

--name -n

The name of directory.

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.

--sas-token

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

--subscription

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

--timeout

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

--yes -y

Do not prompt for confirmation.

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}]
                               [--connection-string]
                               [--sas-token]
                               [--subscription]
                               [--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

Required Parameters

--file-system -f

File system name.

--name -n

The name of directory.

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.

--sas-token

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

--subscription

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

--timeout

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

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}]
                             [--connection-string]
                             [--num-results]
                             [--path]
                             [--query-examples]
                             [--recursive {false, true}]
                             [--sas-token]
                             [--subscription]
                             [--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.

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.

--num-results

Specify the maximum number of results to return.

--path

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

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--recursive

Look into sub-directories recursively when set to true.

accepted values: false, true
default value: 1
--sas-token

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

--subscription

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

--timeout

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

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}]
                             [--connection-string]
                             [--sas-token]
                             [--subscription]
                             [--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

Required Parameters

--file-system -f

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

--sas-token

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

--subscription

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

--timeout

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

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}]
                             [--connection-string]
                             [--query-examples]
                             [--sas-token]
                             [--subscription]
                             [--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

Required Parameters

--file-system -f

File system name.

--name -n

The name of directory.

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.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--sas-token

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

--subscription

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

--timeout

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