Hi azureuser
Thanks for reaching out!
The issue you’re seeing is expected because OneLake endpoints do not fully support all Azure Blob Storage SDK operations, especially older methods like CloudBlob.deleteIfExists. OneLake is built on top of Microsoft Fabric / ADLS Gen2, and it has different API behavior compared to a standard Azure Blob endpoint.
Why this happens
deleteIfExists works normally on Azure Blob Storage, but OneLake is not a traditional Blob service, so the Blob SDK may not behave consistently or may fail silently.
What you should use instead
To work with OneLake, Microsoft recommends using:
DFS (Data Lake Gen2) REST API, or
Azure Storage Blob SDK (latest versions) with DFS endpoints, not classic Blob endpoints.
If you want to delete a file reliably, use:
DataLakeFileClient fileClient = dataLakeServiceClient
.getFileSystemClient("filesystem")
.getDirectoryClient("path")
.getFileClient("file");
fileClient.deleteIfExists();
Recommendation:
Please check the endpoint you are using. If it looks like:
https://<workspace>.onelake.fabric.microsoft.com/...
then Blob APIs may not work as expected.
Switching to DataLake SDK or DFS endpoint should resolve the issue.
Hope this help. Please let me know if you have any questions.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.