az storage blob directory
Note
This reference is part of the storage-preview extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az storage blob directory command. Learn more about extensions.
This command group has been deprecated and will be removed in future release. Use 'az storage fs directory' instead. For more information go to https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/storage/docs/ADLS%20Gen2.md
Manage blob directories in storage account container.
To use the directory commands, please make sure your storage account type is StorageV2.
Commands
Name | Description | Type | Status |
---|---|---|---|
az storage blob directory access |
Manage the access control properties of a directory when Hierarchical Namespace is enabled. |
Extension | Preview and Deprecated |
az storage blob directory access set |
Set the access control properties of a directory. |
Extension | Preview and Deprecated |
az storage blob directory access show |
Show the access control properties of a directory. |
Extension | Preview and Deprecated |
az storage blob directory access update |
Update the access control properties of a directory. |
Extension | Preview and Deprecated |
az storage blob directory create |
Create a storage blob directory in a storage container. |
Extension | Deprecated |
az storage blob directory delete |
Delete a storage blob directory in a storage container. |
Extension | Deprecated |
az storage blob directory download |
Download blobs to a local file path. |
Extension | Deprecated |
az storage blob directory exists |
Check for the existence of a blob directory in a storage container. |
Extension | Deprecated |
az storage blob directory list |
List blobs and blob subdirectories in a storage directory. |
Extension | Deprecated |
az storage blob directory metadata |
Manage directory metadata. |
Extension | Deprecated |
az storage blob directory metadata show |
Show all user-defined metadata for the specified blob directory. |
Extension | Deprecated |
az storage blob directory metadata update |
Set user-defined metadata for the specified blob directory as one or more name-value pairs. |
Extension | Deprecated |
az storage blob directory move |
Move a storage directory to another storage blob directory in a storage container. |
Extension | Deprecated |
az storage blob directory show |
Show a storage blob directory properties in a storage container. |
Extension | Deprecated |
az storage blob directory upload |
Upload blobs or subdirectories to a storage blob directory. |
Extension | Deprecated |
az storage blob directory create
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Create a storage blob directory in a storage container.
Create a storage blob directory which can contain other directories or blobs in a storage container.
az storage blob directory create --container-name
--directory-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--lease-id]
[--metadata]
[--permissions]
[--sas-token]
[--timeout]
[--umask]
Examples
Create a storage blob directory in a storage container.
az storage blob directory create -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount
Create a storage blob directory with permissions and umask.
az storage blob directory create -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount --permissions rwxrwxrwx --umask 0000
Required Parameters
The container name.
The directory path name.
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.
Required if the directory to be overwritten has an active lease.
Metadata in space-separated key=value pairs. This overwrites any existing metadata.
Optional and only valid if Hierarchical Namespace is enabled for the account. Sets 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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Optional and only valid if Hierarchical Namespace is enabled for the account. The umask restricts permission settings for file and directory, and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be disabled. In this way, the resulting permission is given by p & ^u, where p is the permission and u is the umask. Only 4-digit octal notation (e.g. 0022) is supported here.
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 blob directory delete
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Delete a storage blob directory in a storage container.
This operation's behavior is different depending on whether Hierarchical Namespace is enabled; if yes, then the delete operation can be atomic and instantaneous; if not, the operation is performed in batches and a continuation token could be returned.
az storage blob directory delete --container-name
--directory-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--fail-not-exist]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
[--lease-id]
[--marker]
[--recursive]
[--sas-token]
[--timeout]
Examples
Delete a storage blob directory in a storage container.
az storage blob directory delete -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount
Required Parameters
The container name.
The directory path name.
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.
Specify whether to throw an exception when the directory doesn't exist.
An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.
Alter only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').
An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified.
Alter only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').
Required if the directory has an active lease.
Optional. When deleting a directory without the Hierarchical Namespace, the number of paths that are deleted with each invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned. When a continuation token is returned, it must be specified in a subsequent invocation of the delete operation to continue deleting the directory.
If "true", all paths beneath the directory will be deleted. If "false" and the directory is non-empty, an error occurs.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. 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 blob directory download
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Download blobs to a local file path.
az storage blob directory download --container
--destination-path
--source-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--recursive]
[--sas-token]
Examples
Download a single blob in a storage blob directory.
az storage blob directory download -c MyContainer --account-name MyStorageAccount -s "path/to/blob" -d "<local-path>"
Download the entire directory in a storage container.
az storage blob directory download -c MyContainer --account-name MyStorageAccount -s SourceDirectoryPath -d "<local-path>" --recursive
Download an entire subdirectory of a storage blob directory.
az storage blob directory download -c MyContainer --account-name MyStorageAccount -s "path/to/subdirectory" -d "<local-path>" --recursive
Required Parameters
The download source container.
The destination local directory path to download.
The download source directory path. It should be an absolute path to container.
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 blobs. If enabled, all the blobs including the blobs 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.
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 blob directory exists
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Check for the existence of a blob directory in a storage container.
az storage blob directory exists --container-name
--directory-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--sas-token]
[--snapshot]
[--timeout]
Examples
Check for the existence of a blob directory in a storage container.
az storage blob directory exists -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount
Required Parameters
The container name.
The directory path name.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
The snapshot parameter is an opaque DateTime value that, when present, specifies the snapshot.
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 blob directory list
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
List blobs and blob subdirectories in a storage directory.
az storage blob directory list --container-name
--directory-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--delimiter]
[--include]
[--marker]
[--num-results]
[--prefix]
[--sas-token]
[--timeout]
Examples
List blobs and blob subdirectories in a storage directory.
az storage blob directory list -c MyContainer -d DestinationDirectoryPath --account-name MyStorageAccount
Required Parameters
The container name.
The directory path name.
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.
When the request includes this parameter, the operation returns a :class:~azure.storage.blob.models.BlobPrefix
element in the result list that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.
Specifies one or more additional datasets to include in the response.
An opaque continuation token. This value can be retrieved from the next_marker field of a previous generator object if num_results was specified and that generator has finished enumerating results. If specified, this generator will begin returning results from the point where the previous generator stopped.
Specifies the maximum number of results to return. Provide "*" to return all.
Filters the results to return only blobs whose names begin with the specified prefix.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. 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 blob directory move
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Move a storage directory to another storage blob directory in a storage container.
Move a storage directory and all its content (which can contain other directories or blobs) to another storage blob directory in a storage container. This operation's behavior is different depending on whether Hierarchical Namespace is enabled; if yes, the move operation is atomic and no marker is returned; if not, the operation is performed in batches and a continuation token could be returned.
az storage blob directory move --container-name
--destination-path
--source-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--lease-id]
[--move-mode {legacy, posix}]
[--sas-token]
[--source-if-match]
[--source-if-modified-since]
[--source-if-none-match]
[--source-if-unmodified-since]
[--source-lease-id]
[--timeout]
Examples
Move a storage directory to another storage blob directory in a storage container.
az storage blob directory move -c MyContainer -d my-new-directory -s dir --account-name MyStorageAccount
Move a storage subdirectory to another storage blob directory in a storage container.
az storage blob directory move -c MyContainer -d my-new-directory -s dir/subdirectory --account-name MyStorageAccount
Required Parameters
The container name.
The destination blob directory path. It can be a directory or subdirectory name, e.g. dir, dir/subdir. If the destination path exists and is empty, the source will be moved into the destination path. If the destination path does not exist, the destination path will be created and overwritten by the source. To control the move operation for nonempty path, you can use --move-mode to determine its behavior.
The source blob directory path.
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.
A lease ID for destination directory_path. The destination directory_path must have an active lease and the lease ID must match.
Valid only when namespace is enabled. This parameter determines the behavior of the move operation. If the destination directory is empty, for both two mode, the destination directory will be overwritten. But if the destination directory is not empty, in legacy mode the move operation will fail and in posix mode, the source directory will be moved into the destination directory.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Optional. An ETag value. Specify this header to perform the move operation only if the source's ETag matches the value specified.
Optional. A date and time value. Specify this header to perform the move operation only if the source has been modified since the specified date and time.
Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the move operation only if the source's ETag does not match the value specified.
Optional. A date and time value. Specify this header to perform the move operation only if the source has not been modified since the specified date and time.
Optional. A lease ID for the source_path. The source_path must have an active lease and the lease ID must match.
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 blob directory show
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Show a storage blob directory properties in a storage container.
az storage blob directory show --container-name
--directory-path
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
[--lease-id]
[--sas-token]
[--timeout]
Examples
Show a storage blob directory properties in a storage container.
az storage blob directory show -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount
Required Parameters
The container name.
The directory path name.
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.
An ETag value, or the wildcard character (*). Specify this header to perform theoperation only if the resource's ETag matches the value specified.
Alter only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').
An ETag value, or the wildcard character (). Specify this header to performthe operation only if the resource's ETag does not match the value specified. Specify the wildcardcharacter () to perform the operation only if the resource does not exist, and fail the operationif it does exist.
Alter only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').
Required if the blob has an active lease.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. 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 blob directory upload
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
Upload blobs or subdirectories to a storage blob directory.
az storage blob directory upload --container
--destination-path
--source
[--account-key]
[--account-name]
[--auth-mode {key, login}]
[--connection-string]
[--recursive]
[--sas-token]
Examples
Upload a single blob to a storage blob directory.
az storage blob directory upload -c MyContainer --account-name MyStorageAccount -s "path/to/file" -d directory
Upload a local directory to a storage blob directory.
az storage blob directory upload -c MyContainer --account-name MyStorageAccount -s "path/to/directory" -d directory --recursive
Upload a set of files in a local directory to a storage blob directory.
az storage blob directory upload -c MyContainer --account-name MyStorageAccount -s "path/to/file*" -d directory --recursive
Required Parameters
The upload destination container.
The destination path that will be prepended to the blob name.
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.
Recursively upload blobs. If enabled, all the blobs including the blobs 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.
Azure CLI