Azure Data Lake Storage Gen2 REST API Reference

File System Operations

This section details the REST API operations for managing file systems within Azure Data Lake Storage Gen2.

The base URI for Data Lake Storage Gen2 REST API operations is:

https://.dfs.core.windows.net

Create File System

GET /filesystem?resource=account&recursive=true&continuation=continuation

Creates a new file system within a storage account. If the file system already exists, the operation succeeds and no changes are made.

Note: This operation is currently in preview and may be changed or removed.

Request Headers

Header Description Required
x-ms-version Specifies the version of the Data Lake Storage Gen2 REST API to use for the request. Yes
Authorization Specifies the authentication credentials for the request. See Azure Storage Authentication for more details. Yes

Query Parameters

Parameter Description Type Required
resource Optional. Specifies that the request is for a file system. Accepted value is account. String No
recursive Optional. A boolean value that specifies whether to recursively delete the file system and all its contents. Boolean No
continuation Optional. A string value that can be used to continue a list operation. String No

Response

A successful response for creating a file system returns status code 201 (Created). The response may include headers related to the request and the created file system.

List File Systems

GET /?resource=filesystem

Lists all file systems within a storage account. This operation supports continuation tokens for large result sets.

Request Headers

Header Description Required
x-ms-version Specifies the version of the Data Lake Storage Gen2 REST API to use for the request. Yes
Authorization Specifies the authentication credentials for the request. Yes

Query Parameters

Parameter Description Type Required
resource Required. Specifies that the request is for a list of file systems. Accepted value is filesystem. String Yes
continuation Optional. A string value that can be used to continue a list operation. String No
prefix Optional. Filters the results to return only file systems whose names begin with the specified prefix. String No
maxResults Optional. Specifies the maximum number of file systems to return per page. Integer No

Response

A successful response for listing file systems returns status code 200 (OK). The response body contains a JSON object listing the file systems.

{
    "content": [
        {
            "name": "myfilesystem1",
            "lastModified": "2023-10-27T10:00:00Z",
            "etag": "0x8DXXXXXXXXXXXXXX"
        },
        {
            "name": "myfilesystem2",
            "lastModified": "2023-10-27T11:00:00Z",
            "etag": "0x8DYYYYYYYYYYYYYY"
        }
    ],
    "continuation": "nextPageToken"
}

Delete File System

DELETE /filesystem

Deletes a file system from a storage account. The file system must be empty before it can be deleted, unless the recursive parameter is set to true.

Request Headers

Header Description Required
x-ms-version Specifies the version of the Data Lake Storage Gen2 REST API to use for the request. Yes
Authorization Specifies the authentication credentials for the request. Yes

Query Parameters

Parameter Description Type Required
recursive Optional. A boolean value that specifies whether to recursively delete the file system and all its contents. Boolean No

Response

A successful response for deleting a file system returns status code 200 (OK). If the file system is not empty and recursive is not set to true, a 409 Conflict error will be returned.


For more detailed information on specific operations, please refer to the official Azure Data Lake Storage Gen2 REST API documentation.