In an Azure Data Lake Storage account with hierarchical namespace (ADLS Gen2), a folder (directory) rename is a single iterative write operation, regardless of how many files it contains. The cost and behavior differ significantly from a flat-namespace Blob account, where each blob would need to be copied and deleted.
Cost model for renaming a folder with 10M files in ADLS
For hierarchical namespace (Data Lake endpoint dfs.core.windows.net):
- Directory rename is billed as one iterative write operation.
- Sample (fictitious) price for iterative write operations to the Data Lake endpoint is:
- $0.1430 per 100 iterative write operations in all tiers (Hot/Cool/Cold/Archive).
- Therefore, renaming a single directory (even with 10M files) costs on the order of one iterative write:
- Approximate operation cost ≈ $0.1430 / 100 = $0.00143 per directory rename (using the sample prices).
The documentation also compares directory rename costs:
- For hierarchical namespace (Data Lake), renaming 1,000 directories (each with 1,000 blobs) costs $0.715 in the hot tier, which is consistent with 1,000 iterative write operations at $0.1430 per 100.
- This confirms that the cost is per-directory-rename, not per-file.
So, renaming one folder that contains 10 million files in ADLS RA-GRS West Europe will still be charged as one iterative write operation at the Data Lake endpoint, using the applicable regional/tier price for iterative writes. The example numbers above are sample prices; the actual RA‑GRS West Europe price must be taken from the official pricing page, but the billing unit (1 iterative write per directory rename) remains the same.
Difference: write vs iterative write
From the provided pricing tables:
- Blob Service endpoint (
blob.core.windows.net)
- Standard write operations are priced per 10,000 operations.
- In a flat namespace, renaming effectively means copy + delete per blob, so renaming many blobs is many write operations.
- Data Lake Storage endpoint (
dfs.core.windows.net)
- Write operations (every 4 MiB) are priced per 10,000.
- Iterative write operations are priced per 100 and are used for metadata-heavy, multi-object operations, such as directory renames.
- A directory rename in ADLS is such an iterative write and does not iterate over and bill per file.
This is why renaming directories is far cheaper and more efficient in hierarchical namespace accounts than in flat namespace accounts.
Time to rename a folder with 10M files
The documentation provides cost and operation type, but not explicit time/latency guarantees. What is documented:
- In hierarchical namespace accounts, directories are concrete objects and can be renamed in a single operation.
- The rename is an iterative write at the metadata layer, not a full data copy of all files.
Implications:
- The operation is metadata-only, so it is much faster than copying 10M files.
- Actual duration depends on service load, namespace complexity, and internal implementation, and is not quantified in the provided material.
For ADLS Gen2, a directory can be renamed using the .NET SDK or CLI as a single operation:
- .NET example (DataLakeDirectoryClient):
public async Task<DataLakeDirectoryClient> RenameDirectory(
DataLakeFileSystemClient fileSystemClient,
string directoryPath,
string subdirectoryName,
string subdirectoryNameNew)
{
DataLakeDirectoryClient directoryClient =
fileSystemClient.GetDirectoryClient(string.Join('/', directoryPath, subdirectoryName));
return await directoryClient.RenameAsync(string.Join('/', directoryPath, subdirectoryNameNew));
}
This call issues a single directory rename, which is billed as one iterative write operation.
If using the older ADLS client library, AdlsClient.RenameAsync also renames a directory in one call.
References: