diff --git a/sdk/storage/Azure.Storage.Files.DataLake/assets.json b/sdk/storage/Azure.Storage.Files.DataLake/assets.json index a52ec21ded409..424ad23002c97 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/assets.json +++ b/sdk/storage/Azure.Storage.Files.DataLake/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.DataLake", - "Tag": "net/storage/Azure.Storage.Files.DataLake_369e19e7ec" + "Tag": "net/storage/Azure.Storage.Files.DataLake_7989a584e7" } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs index aa69810a0c6d3..42f21f591b1dd 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs @@ -1865,6 +1865,7 @@ private async Task DeleteInternal( // Pagination only applies to service version 2023-08-03 and later, when using OAuth. bool? paginated = null; if (_clientConfiguration.ClientOptions.Version >= DataLakeClientOptions.ServiceVersion.V2023_08_03 + && recursive.GetValueOrDefault() && _clientConfiguration.TokenCredential != null) { paginated = true; diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs index 408aece35d7a7..c784e55bcee9a 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs @@ -951,6 +951,20 @@ public async Task DeleteAsync() await fileClient.DeleteAsync(); } + [RecordedTest] + public async Task DeleteAsync_OAuth() + { + DataLakeServiceClient oauthService = GetServiceClient_OAuth(); + await using DisposingFileSystem test = await GetNewFileSystem(oauthService); + DataLakeDirectoryClient directory = await test.FileSystem.CreateDirectoryAsync(GetNewDirectoryName()); + + // Arrange + DataLakeFileClient fileClient = await directory.CreateFileAsync(GetNewFileName()); + + // Act + await fileClient.DeleteAsync(); + } + [RecordedTest] public async Task DeleteFileAsync_Error() {