Path - Delete
Delete File | Delete Directory
Delete the file or directory. This operation supports conditional HTTP requests. For more information, see Specifying Conditional Headers for Blob Service Operations. Note: The 'Path - Delete' API does not support deletion of blob versions. For more information on deleting blobs with versions, see Delete Blob.
DELETE https://{accountName}.{dnsSuffix}/{filesystem}/{path}
DELETE https://{accountName}.{dnsSuffix}/{filesystem}/{path}?recursive={recursive}&continuation={continuation}&paginated={paginated}&timeout={timeout}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
account
|
path | True |
string |
The Azure Storage account name. |
dns
|
path | True |
string |
The DNS suffix for the Azure Data Lake Storage endpoint. |
filesystem
|
path | True |
string |
The filesystem identifier. Regex pattern: |
path
|
path | True |
string |
The file or directory path. |
continuation
|
query |
string |
Optional. When deleting a directory, 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 in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the delete operation to continue deleting the directory. |
|
paginated
|
query |
boolean |
Optional and valid only if Hierarchical Namespace is enabled for the account and resource is a directory with "recursive" query parameter set to "true". For recursive directory deletion, the number of paths that could be deleted with each invocation is limited when the authorization mechanism used is ACL and the caller is a non-super user, as the default timeout is 30 seconds. When "paginated" query parameter is set to "true", the response header may contain "x-ms-continuation" if the above limit is hit. While sending the "x-ms-continuation" in the subsequnt request, "paginated" and "recursive" query parameter should be set to "true". When the response doesnt contain any "x-ms-continuation", recursive directory deletion is successful. The actual directory deletion happens only in the last invocation, the previous ones involve ACL checks in the server of the files and directories under the directory to be recursively deleted. |
|
recursive
|
query |
boolean |
Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted. If "false" and the directory is non-empty, an error occurs. |
|
timeout
|
query |
integer int32 |
An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
x-ms-lease-id |
string |
The lease ID must be specified if there is an active lease. Regex pattern: |
|
If-Match |
string |
Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes. |
|
If-None-Match |
string |
Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes. |
|
If-Modified-Since |
string |
Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time. |
|
If-Unmodified-Since |
string |
Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time. |
|
x-ms-client-request-id |
string |
A UUID recorded in the analytics logs for troubleshooting and correlation. Regex pattern: |
|
x-ms-date |
string |
Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization. |
|
x-ms-version |
string |
Specifies the version of the REST protocol used for processing the request. This is required when using shared key authorization. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The file was deleted. Headers
|
|
202 Accepted |
Delete request is accepted, applicable only when Hierarchical Namespace is enabled for the account. Headers
|
|
Other Status Codes |
An error occurred. The possible HTTP status, code, and message strings are listed below:
Headers
|
Definitions
Name | Description |
---|---|
Data |
|
Error |
The service error response object. |
DataLakeStorageError
Name | Type | Description |
---|---|---|
error |
The service error response object. |
Error
The service error response object.
Name | Type | Description |
---|---|---|
code |
string |
The service error code. |
message |
string |
The service error message. |