Filesystem Operations
This section describes the REST endpoints for managing file systems in Azure Data Lake Storage Gen2.
Create File System
Method: PUT
URI: https://<account-name>.dfs.core.windows.net/<filesystem-name>?resource=filesystem
PUT https://myaccount.dfs.core.windows.net/myfilesystem?resource=filesystem Headers: Authorization: Bearer <token> x-ms-version: 2022-11-02 x-ms-date: Wed, 12 Sep 2025 08:00:00 GMT Content-Length: 0
HTTP/1.1 201 Created Headers: x-ms-request-id: 1234567890abcdef x-ms-version: 2022-11-02 Date: Wed, 12 Sep 2025 08:00:01 GMT
var service = new DataLakeServiceClient(new Uri("https://myaccount.dfs.core.windows.net"), new DefaultAzureCredential()); var fileSystem = service.GetFileSystemClient("myfilesystem"); await fileSystem.CreateIfNotExistsAsync();
from azure.storage.filedatalake import DataLakeServiceClient service = DataLakeServiceClient(account_url="https://myaccount.dfs.core.windows.net", credential=DefaultAzureCredential()) file_system_client = service.get_file_system_client("myfilesystem") file_system_client.create_file_system()
Delete File System
Method: DELETE
URI: https://<account-name>.dfs.core.windows.net/<filesystem-name>
DELETE https://myaccount.dfs.core.windows.net/myfilesystem Headers: Authorization: Bearer <token> x-ms-version: 2022-11-02 x-ms-date: Wed, 12 Sep 2025 09:00:00 GMT
HTTP/1.1 202 Accepted Headers: x-ms-request-id: abcdef1234567890 x-ms-version: 2022-11-02 Date: Wed, 12 Sep 2025 09:00:01 GMT
await fileSystem.DeleteAsync();
file_system_client.delete_file_system()
List File Systems
Method: GET
URI: https://<account-name>.dfs.core.windows.net/?resource=filesystem
GET https://myaccount.dfs.core.windows.net/?resource=filesystem Headers: Authorization: Bearer <token> x-ms-version: 2022-11-02 x-ms-date: Wed, 12 Sep 2025 10:15:00 GMT
HTTP/1.1 200 OK Headers: x-ms-version: 2022-11-02 Content-Type: application/xml Body: <EnumerationResults ServiceEndpoint="https://myaccount.dfs.core.windows.net/"> <FileSystems> <FileSystem> <Name>myfilesystem</Name> <Properties> <Last-Modified>Wed, 12 Sep 2025 08:00:00 GMT</Last-Modified> <Etag>"0x8D123456789ABC0"</Etag> </Properties> </FileSystem> <FileSystem> <Name>archive</Name> <Properties> <Last-Modified>Tue, 10 Sep 2025 15:30:00 GMT</Last-Modified> <Etag>"0x8D12345000FEDC0"</Etag> </Properties> </FileSystem> </FileSystems> </EnumerationResults>
await foreach (var fs in service.GetFileSystemsAsync()) { Console.WriteLine(fs.Name); }
for fs in service.list_file_systems(): print(fs.name)
Get File System Properties
Method: HEAD
URI: https://<account-name>.dfs.core.windows.net/<filesystem-name>
HEAD https://myaccount.dfs.core.windows.net/myfilesystem Headers: Authorization: Bearer <token> x-ms-version: 2022-11-02 x-ms-date: Wed, 12 Sep 2025 11:00:00 GMT
HTTP/1.1 200 OK Headers: Last-Modified: Wed, 12 Sep 2025 08:00:00 GMT ETag: "0x8D123456789ABC0" x-ms-version: 2022-11-02 x-ms-request-id: 0a1b2c3d4e5f6g7h8i9j x-ms-lease-status: unlocked x-ms-lease-state: available Date: Wed, 12 Sep 2025 11:00:01 GMT
Set File System ACL
Method: PATCH
URI: https://<account-name>.dfs.core.windows.net/<filesystem-name>?action=setAccessControl
PATCH https://myaccount.dfs.core.windows.net/myfilesystem?action=setAccessControl Headers: Authorization: Bearer <token> x-ms-version: 2022-11-02 x-ms-date: Wed, 12 Sep 2025 12:30:00 GMT Content-Type: application/xml Body: <SignedIdentifiers> <SignedIdentifier> <Id>policy1</Id> <AccessPolicy> <Start>2025-09-12T00:00:00Z</Start> <Expiry>2026-09-12T00:00:00Z</Expiry> <Permission>racwdl</Permission> </AccessPolicy> </SignedIdentifier> </SignedIdentifiers>
HTTP/1.1 200 OK Headers: x-ms-request-id: a1b2c3d4e5f6g7h8i9j0 x-ms-version: 2022-11-02 Date: Wed, 12 Sep 2025 12:30:01 GMT
Error Codes
Common HTTP status codes returned by the Filesystem API:
- 400 – Bad Request (invalid parameters)
- 401 – Unauthorized (missing or invalid auth header)
- 403 – Forbidden (insufficient permissions)
- 404 – Not Found (filesystem does not exist)
- 409 – Conflict (filesystem already exists)
- 500 – Internal Server Error