az storage fs

Manage file systems in Azure Data Lake Storage Gen2 account.

Commands

az storage fs access

Manage file system access and permissions for Azure Data Lake Storage Gen2 account.

az storage fs access remove-recursive

Remove the Access Control on a path and sub-paths in Azure Data Lake Storage Gen2 account.

az storage fs access set

Set the access control properties of a path(directory or file) in Azure Data Lake Storage Gen2 account.

az storage fs access set-recursive

Set the Access Control on a path and sub-paths in Azure Data Lake Storage Gen2 account.

az storage fs access show

Show the access control properties of a path (directory or file) in Azure Data Lake Storage Gen2 account.

az storage fs access update-recursive

Modify the Access Control on a path and sub-paths in Azure Data Lake Storage Gen2 account.

az storage fs create

Create file system for Azure Data Lake Storage Gen2 account.

az storage fs delete

Delete a file system in ADLS Gen2 account.

az storage fs directory

Manage directories in Azure Data Lake Storage Gen2 account.

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 download

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

az storage fs directory exists

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

az storage fs directory generate-sas

Generate a SAS token for directory in ADLS Gen2 account.

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 upload

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

az storage fs exists

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

az storage fs file

Manage files in Azure Data Lake Storage Gen2 account.

az storage fs file append

Append content to a file in ADLS Gen2 file system.

az storage fs file create

Create a new file in ADLS Gen2 file system.

az storage fs file delete

Delete a file in ADLS Gen2 file system.

az storage fs file download

Download a file from the specified path in ADLS Gen2 file system.

az storage fs file exists

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

az storage fs file list

List files and directories in ADLS Gen2 file system.

az storage fs file metadata

Manage the metadata for file in file system.

az storage fs file metadata show

Return all user-defined metadata for the specified file.

az storage fs file metadata update

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

az storage fs file move

Move a file in ADLS Gen2 Account.

az storage fs file set-expiry

Sets the time a file will expire and be deleted.

az storage fs file show

Show properties of file in ADLS Gen2 file system.

az storage fs file upload

Upload a file to a file path in ADLS Gen2 file system.

az storage fs generate-sas

Generate a SAS token for file system in ADLS Gen2 account.

az storage fs list

List file systems in ADLS Gen2 account.

az storage fs list-deleted-path

List the deleted (file or directory) paths under the specified file system.

az storage fs metadata

Manage the metadata for file system.

az storage fs metadata show

Return all user-defined metadata for the specified file system.

az storage fs metadata update

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

az storage fs service-properties

Manage storage datalake service properties.

az storage fs service-properties show

Show the properties of a storage account's datalake service, including Azure Storage Analytics.

az storage fs service-properties update

Update the properties of a storage account's datalake service, including Azure Storage Analytics.

az storage fs show

Show properties of file system in ADLS Gen2 account.

az storage fs undelete-path

Restore soft-deleted path.

az storage fs create

Create file system for Azure Data Lake Storage Gen2 account.

az storage fs create --name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--blob-endpoint]
                     [--connection-string]
                     [--default-encryption-scope]
                     [--metadata]
                     [--prevent-encryption-scope-override {false, true}]
                     [--public-access {file, filesystem, off}]
                     [--sas-token]
                     [--timeout]

Examples

Create file system for Azure Data Lake Storage Gen2 account.

az storage fs create -n fsname --account-name mystorageaccount --account-key 0000-0000

Create file system for Azure Data Lake Storage Gen2 account and enable public access.

az storage fs create -n fsname --public-access file --account-name mystorageaccount --account-key 0000-0000

Create file system for Azure Data Lake Storage Gen2 account. (autogenerated)

az storage fs create --account-name mystorageaccount --auth-mode login --name fsname

Required Parameters

--name -n

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.

--default-encryption-scope -d

Specify the default encryption scope to set on the file system and use for all future writes.

--metadata

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

--prevent-encryption-scope-override -p

If true, prevents any request from specifying a different encryption scope than the scope set on the file system. Default value is false.

accepted values: false, true
--public-access

Specify whether data in the file system may be accessed publicly and the level of access.

accepted values: file, filesystem, off
--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.

az storage fs delete

Delete a file system in ADLS Gen2 account.

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

Examples

Delete a file system in ADLS Gen2 account.

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

Required Parameters

--name -n

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.

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

az storage fs exists

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

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

Examples

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

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

Required Parameters

--name -n

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.

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

az storage fs generate-sas

Generate a SAS token for file system in ADLS Gen2 account.

az storage fs generate-sas --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 file system and use it to upload files.

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

Required Parameters

--name -n

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.

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

az storage fs list

List file systems in ADLS Gen2 account.

az storage fs list [--account-key]
                   [--account-name]
                   [--auth-mode {key, login}]
                   [--blob-endpoint]
                   [--connection-string]
                   [--include-metadata {false, true}]
                   [--prefix]
                   [--sas-token]

Examples

List file systems in ADLS Gen2 account.

az storage fs list --account-name myadlsaccount --account-key 0000-0000

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.

--include-metadata

Specify that file system metadata be returned in the response. The default value is "False".

accepted values: false, true
--prefix

Filter the results to return only file systems whose names begin with the specified prefix.

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

az storage fs list-deleted-path

List the deleted (file or directory) paths under the specified file system.

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

Examples

List the deleted (file or directory) paths under the specified file system..

az storage fs list-deleted-path -f myfilesystem --account-name mystorageccount --account-key 00000000

Required Parameters

--file-system -f

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

--marker

A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. If specified, this generator will begin returning results from the point where the previous generator stopped.

--num-results

Specify the maximum number to return.

--path-prefix

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

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

az storage fs show

Show properties of file system in ADLS Gen2 account.

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

Examples

Show properties of file system in ADLS Gen2 account.

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

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

az storage fs show --account-name myadlsaccount --auth-mode login --name myfilesystem

Required Parameters

--name -n

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.

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

az storage fs undelete-path

Restore soft-deleted path.

Operation will only be successful if used within the specified number of days set in the delete retention policy.

az storage fs undelete-path --deleted-path-name
                            --deletion-id
                            --file-system
                            [--account-key]
                            [--account-name]
                            [--auth-mode {key, login}]
                            [--blob-endpoint]
                            [--connection-string]
                            [--sas-token]
                            [--timeout]

Examples

Restore soft-deleted path.

az storage fs undelete-path -f myfilesystem --deleted-path-name dir --deletion-id 0000 --account-name mystorageccount --account-key 00000000

Required Parameters

--deleted-path-name

Specifies the path (file or directory) to restore.

--deletion-id

Specifies the version of the deleted path to restore. :keyword int timeout: The timeout parameter is expressed in seconds.

--file-system -f

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

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