From 7a420e29133fd1381d659fab47e7d39505cbdbc6 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Wed, 10 Jul 2024 16:37:03 -0700 Subject: [PATCH 1/7] WIP - still need to record tests --- .../Azure.Storage.Blobs/src/BlobUriBuilder.cs | 2 +- .../tests/BlobBaseClientTests.cs | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobUriBuilder.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobUriBuilder.cs index aa506a6f8c951..1457fe29a13ac 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobUriBuilder.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobUriBuilder.cs @@ -204,7 +204,7 @@ public BlobUriBuilder(Uri uri, bool trimBlobNameSlashes) // Find the account, container, & blob names (if any) if (!string.IsNullOrEmpty(uri.AbsolutePath)) { - var path = uri.GetPath(); + var path = string.Concat(uri.GetPath(), uri.Fragment); var startIndex = 0; diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 31ad90420436e..5820b96420f79 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -23,6 +23,8 @@ using Azure.Storage.Test; using Azure.Storage.Test.Shared; using Azure.Storage.Tests.Shared; +using BenchmarkDotNet.Toolchains; +using Microsoft.Extensions.Options; using Moq; using Moq.Protected; using NUnit.Framework; @@ -104,6 +106,37 @@ public async Task Ctor_ConnectionStringEscapeBlobName() Assert.AreEqual(uploadResponse.Value.ETag, propertiesResponse.Value.ETag); } + [RecordedTest] + public async Task Ctor_EscapeBlobName() + { + // Arrange + string blobName = "!*'();[]:@&%=+$,/#äÄöÖüÜß"; + await using DisposingContainer test = await GetTestContainerAsync(); + var data = GetRandomBuffer(Constants.KB); + BlobClient blob = InstrumentClient(test.Container.GetBlobClient(blobName)); + ETag originalEtag; + using (var stream = new MemoryStream(data)) + { + BlobContentInfo info = await blob.UploadAsync(stream); + originalEtag = info.ETag; + } + + // Act + BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) + { + BlobContainerName = blob.BlobContainerName, + BlobName = blobName + }; + BlobBaseClient freshBlobClient = InstrumentClient(new BlobBaseClient( + uriBuilder.ToUri(), + Tenants.GetNewSharedKeyCredentials())); + + // Assert + Assert.AreEqual(blobName, freshBlobClient.Name); + BlobProperties propertiesResponse = await freshBlobClient.GetPropertiesAsync(); + Assert.AreEqual(originalEtag, propertiesResponse.ETag); + } + [RecordedTest] public void Ctor_Uri() { From 14e3215e849137fb73dc686f7104d05b4c1b047e Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Wed, 10 Jul 2024 22:13:15 -0700 Subject: [PATCH 2/7] Recordings --- sdk/storage/Azure.Storage.Blobs/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index ed50b4446fc0d..2c94f49a17435 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_62a8c8fa29" + "Tag": "net/storage/Azure.Storage.Blobs_272c3196d3" } From 7e830bb0470234a179cc640fe6a3755a7a6c1d5d Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Wed, 10 Jul 2024 22:52:53 -0700 Subject: [PATCH 3/7] Cleanup --- sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 5820b96420f79..d041cf8cd3270 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -23,8 +23,6 @@ using Azure.Storage.Test; using Azure.Storage.Test.Shared; using Azure.Storage.Tests.Shared; -using BenchmarkDotNet.Toolchains; -using Microsoft.Extensions.Options; using Moq; using Moq.Protected; using NUnit.Framework; From a49fb965a68bb70f825331e52f1eaf13f8f8ff86 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Thu, 11 Jul 2024 10:38:17 -0700 Subject: [PATCH 4/7] Fixed recordings --- sdk/storage/Azure.Storage.Blobs/assets.json | 2 +- sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index 2c94f49a17435..b17bd6ca96b9b 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_272c3196d3" + "Tag": "net/storage/Azure.Storage.Blobs_d4fb3a6320" } diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index d041cf8cd3270..102ec51e8178b 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -127,7 +127,8 @@ public async Task Ctor_EscapeBlobName() }; BlobBaseClient freshBlobClient = InstrumentClient(new BlobBaseClient( uriBuilder.ToUri(), - Tenants.GetNewSharedKeyCredentials())); + Tenants.GetNewSharedKeyCredentials(), + GetOptions())); // Assert Assert.AreEqual(blobName, freshBlobClient.Name); From 2785c1609d3f99a3106b398f2cc3627d8384e566 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Thu, 11 Jul 2024 16:04:31 -0700 Subject: [PATCH 5/7] Added fix for Shares and Datalake, Updated tests to use OAuth, Updated Changelogs --- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 1 + sdk/storage/Azure.Storage.Blobs/assets.json | 2 +- .../tests/BlobBaseClientTests.cs | 2 +- .../Azure.Storage.Files.DataLake/CHANGELOG.md | 1 + .../Azure.Storage.Files.DataLake/assets.json | 2 +- .../src/DataLakeUriBuilder.cs | 2 +- .../tests/DirectoryClientTests.cs | 28 ++++++++ .../tests/FileClientTests.cs | 33 +++++++++ .../Azure.Storage.Files.Shares/CHANGELOG.md | 1 + .../Azure.Storage.Files.Shares/assets.json | 2 +- .../src/ShareUriBuilder.cs | 2 +- .../tests/DirectoryClientTests.cs | 27 ++++++++ .../tests/FileClientTests.cs | 68 ++++++++++++++----- 13 files changed, 149 insertions(+), 22 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index cee8ee19e8932..16c2f2781fad0 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fixed bug where storage clients when constructed with URLs with '#' character would truncate the blob name at the '#'. ### Other Changes diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index b17bd6ca96b9b..5539b0df43f81 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_d4fb3a6320" + "Tag": "net/storage/Azure.Storage.Blobs_63b4909656" } diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 102ec51e8178b..14105ca0a4645 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -127,7 +127,7 @@ public async Task Ctor_EscapeBlobName() }; BlobBaseClient freshBlobClient = InstrumentClient(new BlobBaseClient( uriBuilder.ToUri(), - Tenants.GetNewSharedKeyCredentials(), + TestEnvironment.Credential, GetOptions())); // Assert diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index 23694b6f65c04..876725a114639 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fixed bug where storage clients when constructed with URLs with '#' character would truncate the path at the '#'. ### Other Changes diff --git a/sdk/storage/Azure.Storage.Files.DataLake/assets.json b/sdk/storage/Azure.Storage.Files.DataLake/assets.json index 9c7dfffe8d717..3017e52af2d97 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_aaa95f3b1a" + "Tag": "net/storage/Azure.Storage.Files.DataLake_cb6521e860" } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeUriBuilder.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeUriBuilder.cs index ae789de151eac..8b65f6e888127 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeUriBuilder.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeUriBuilder.cs @@ -181,7 +181,7 @@ public DataLakeUriBuilder(Uri uri) // Find the share & directory/file path (if any) if (!string.IsNullOrEmpty(uri.AbsolutePath)) { - var path = uri.GetPath(); + var path = string.Concat(uri.GetPath(), uri.Fragment); var startIndex = 0; diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs index 94571d815ccbc..b6e6d0030d660 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs @@ -335,6 +335,34 @@ await TestHelper.AssertExpectedExceptionAsync( e => Assert.AreEqual("InvalidAuthenticationInfo", e.ErrorCode)); } + [RecordedTest] + public async Task Ctor_EscapeName() + { + // Arrange + string directoryName = "!*'();[]:@&%=+$,#äÄöÖüÜß"; + await using DisposingFileSystem test = await GetNewFileSystem(); + int size = Constants.KB; + var data = GetRandomBuffer(size); + DataLakeDirectoryClient directory = InstrumentClient(test.Container.GetDirectoryClient(directoryName)); + await directory.CreateAsync(); + + // Act + DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) + { + FileSystemName = directory.FileSystemName, + DirectoryOrFilePath = directoryName + }; + DataLakeDirectoryClient freshDirectoryClient = InstrumentClient(new DataLakeDirectoryClient( + uriBuilder.ToUri(), + TestEnvironment.Credential, + GetOptions())); + + // Assert + bool exists = await freshDirectoryClient.ExistsAsync(); + Assert.True(exists); + Assert.AreEqual(directoryName, freshDirectoryClient.Name); + } + [RecordedTest] [TestCase(false)] [TestCase(true)] diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs index 7af1076179718..b65f0a67f0948 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs @@ -338,6 +338,39 @@ await TestHelper.AssertExpectedExceptionAsync( e => Assert.AreEqual("InvalidAuthenticationInfo", e.ErrorCode)); } + [RecordedTest] + public async Task Ctor_EscapeName() + { + // Arrange + string fileName = "!*'();[]:@&%=+$,#äÄöÖüÜß"; + await using DisposingFileSystem test = await GetNewFileSystem(); + int size = Constants.KB; + var data = GetRandomBuffer(size); + DataLakeFileClient file = InstrumentClient(test.Container.GetFileClient(fileName)); + ETag originalEtag; + using (var stream = new MemoryStream(data)) + { + PathInfo info = await file.UploadAsync(stream); + originalEtag = info.ETag; + } + + // Act + DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) + { + FileSystemName = file.FileSystemName, + DirectoryOrFilePath = fileName + }; + DataLakeFileClient freshFileClient = InstrumentClient(new DataLakeFileClient( + uriBuilder.ToUri(), + TestEnvironment.Credential, + GetOptions())); + + // Assert + Assert.AreEqual(fileName, freshFileClient.Name); + PathProperties propertiesResponse = await freshFileClient.GetPropertiesAsync(); + Assert.AreEqual(originalEtag, propertiesResponse.ETag); + } + [RecordedTest] [TestCase(false)] [TestCase(true)] diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index 03edc6c7b700f..3c5f19c01376a 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fixed bug where storage clients when constructed with URLs with '#' character would truncate the path at the '#'. ### Other Changes diff --git a/sdk/storage/Azure.Storage.Files.Shares/assets.json b/sdk/storage/Azure.Storage.Files.Shares/assets.json index 84bc3ffca974c..040738813aa57 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.Shares", - "Tag": "net/storage/Azure.Storage.Files.Shares_3d104d438e" + "Tag": "net/storage/Azure.Storage.Files.Shares_1665034009" } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs index 38d0830aa5743..99ec7f24621f6 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs @@ -174,7 +174,7 @@ public ShareUriBuilder(Uri uri) if (!string.IsNullOrEmpty(uri.AbsolutePath)) { // If path starts with a slash, remove it - var path = uri.GetPath(); + var path = string.Concat(uri.GetPath(), uri.Fragment); var startIndex = 0; diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs index 9c30baaf95d6d..3c2dd61afc33c 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using Azure.Core.TestFramework; @@ -213,6 +214,32 @@ await TestHelper.AssertExpectedExceptionAsync( e => Assert.AreEqual("InvalidAuthenticationInfo", e.ErrorCode)); } + [RecordedTest] + public async Task Ctor_EscapeDirectoryName() + { + // Arrange + string directoryName = "$=;!#öÖ"; + await using DisposingShare test = await GetTestShareAsync(); + int size = Constants.KB; + var data = GetRandomBuffer(size); + ShareDirectoryClient directory = InstrumentClient(test.Share.GetDirectoryClient(directoryName)); + await directory.CreateAsync(); + + // Act + ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) + { + ShareName = directory.ShareName, + DirectoryOrFilePath = directoryName + }; + ShareDirectoryClient freshDirectoryClient = InstrumentClient(new ShareDirectoryClient( + uriBuilder.ToUri(), + TestEnvironment.Credential, + GetOptions())); + + // Assert + Assert.AreEqual(directoryName, freshDirectoryClient.Name); + } + [RecordedTest] public void DirectoryPathsParsing() { diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs index f8d12a29c50f1..664c68539f2be 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs @@ -117,7 +117,7 @@ public async Task Ctor_DefaultAudience() ShareFileClient fileClient = directoryClient.GetFileClient(GetNewFileName()); await fileClient.CreateAsync(Constants.KB); - // Act - Create new blob client with the OAuth Credential and Audience + // Act - Create new Share client with the OAuth Credential and Audience ShareClientOptions options = GetOptionsWithAudience(ShareAudience.DefaultAudience); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) @@ -146,7 +146,7 @@ public async Task Ctor_CustomAudience() ShareFileClient fileClient = directoryClient.GetFileClient(GetNewFileName()); await fileClient.CreateAsync(Constants.KB); - // Act - Create new blob client with the OAuth Credential and Audience + // Act - Create new Share client with the OAuth Credential and Audience ShareClientOptions options = GetOptionsWithAudience(new ShareAudience($"https://{test.Share.AccountName}.file.core.windows.net/")); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) @@ -175,7 +175,7 @@ public async Task Ctor_StorageAccountAudience() ShareFileClient fileClient = directoryClient.GetFileClient(GetNewFileName()); await fileClient.CreateAsync(Constants.KB); - // Act - Create new blob client with the OAuth Credential and Audience + // Act - Create new Share client with the OAuth Credential and Audience ShareClientOptions options = GetOptionsWithAudience(ShareAudience.CreateShareServiceAccountAudience(test.Share.AccountName)); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) @@ -194,6 +194,42 @@ public async Task Ctor_StorageAccountAudience() Assert.IsNotNull(exists); } + [RecordedTest] + public async Task Ctor_EscapeFileName() + { + // Arrange + string fileName = "$=;!#öÖ"; + await using DisposingShare test = await GetTestShareAsync(); + int size = Constants.KB; + var data = GetRandomBuffer(size); + ShareFileClient file = InstrumentClient(test.Share.GetRootDirectoryClient().GetFileClient(fileName)); + ETag originalEtag; + await file.CreateAsync(size); + using (var stream = new MemoryStream(data)) + { + ShareFileUploadInfo info = await file.UploadAsync(stream); + originalEtag = info.ETag; + } + + // Act + ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) + { + ShareName = test.Share.Name, + DirectoryOrFilePath = fileName + }; + ShareClientOptions options = GetOptions(); + options.ShareTokenIntent = ShareTokenIntent.Backup; + ShareFileClient freshFileClient = InstrumentClient(new ShareFileClient( + uriBuilder.ToUri(), + TestEnvironment.Credential, + options)); + + // Assert + Assert.AreEqual(fileName, freshFileClient.Name); + ShareFileProperties propertiesResponse = await freshFileClient.GetPropertiesAsync(); + Assert.AreEqual(originalEtag, propertiesResponse.ETag); + } + [RecordedTest] public async Task Ctor_AudienceError() { @@ -204,8 +240,8 @@ public async Task Ctor_AudienceError() ShareFileClient fileClient = directoryClient.GetFileClient(GetNewFileName()); await fileClient.CreateAsync(Constants.KB); - // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(new ShareAudience("https://badaudience.blob.core.windows.net")); + // Act - Create new Share client with the OAuth Credential and Audience + ShareClientOptions options = GetOptionsWithAudience(new ShareAudience("https://badaudience.Share.core.windows.net")); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { @@ -4035,7 +4071,7 @@ public async Task ClearRangeAsync_TrailingDot() [TestCase(30 * Constants.KB)] [TestCase(50 * Constants.KB)] [TestCase(501 * Constants.KB)] - public async Task UploadAsync_SmallBlobs(int size) => + public async Task UploadAsync_SmallShares(int size) => // Use a 1KB threshold so we get a lot of individual blocks await UploadAndVerify(size, Constants.KB); @@ -4045,7 +4081,7 @@ public async Task UploadAsync_SmallBlobs(int size) => [TestCase(257 * Constants.MB)] [TestCase(1 * Constants.GB)] [Explicit("https://github.com/Azure/azure-sdk-for-net/issues/9120")] - public async Task UploadAsync_LargeBlobs(int size) => + public async Task UploadAsync_LargeShares(int size) => // TODO: #6781 We don't want to add 1GB of random data in the recordings await UploadAndVerify(size, Constants.MB); @@ -6340,19 +6376,19 @@ public void CanGenerateSas_ClientConstructors() { // Arrange var constants = TestConstants.Create(this); - var blobEndpoint = new Uri("https://127.0.0.1/" + constants.Sas.Account); - var blobSecondaryEndpoint = new Uri("https://127.0.0.1/" + constants.Sas.Account + "-secondary"); - var storageConnectionString = new StorageConnectionString(constants.Sas.SharedKeyCredential, fileStorageUri: (blobEndpoint, blobSecondaryEndpoint)); + var ShareEndpoint = new Uri("https://127.0.0.1/" + constants.Sas.Account); + var ShareSecondaryEndpoint = new Uri("https://127.0.0.1/" + constants.Sas.Account + "-secondary"); + var storageConnectionString = new StorageConnectionString(constants.Sas.SharedKeyCredential, fileStorageUri: (ShareEndpoint, ShareSecondaryEndpoint)); string connectionString = storageConnectionString.ToString(true); - // Act - ShareDirectoryClient(string connectionString, string blobContainerName, string blobName) + // Act - ShareDirectoryClient(string connectionString, string ShareContainerName, string ShareName) ShareFileClient directory = InstrumentClient(new ShareFileClient( connectionString, GetNewShareName(), GetNewDirectoryName())); Assert.IsTrue(directory.CanGenerateSasUri); - // Act - ShareFileClient(string connectionString, string blobContainerName, string blobName, BlobClientOptions options) + // Act - ShareFileClient(string connectionString, string ShareContainerName, string ShareName, ShareClientOptions options) ShareFileClient directory2 = InstrumentClient(new ShareFileClient( connectionString, GetNewShareName(), @@ -6360,15 +6396,15 @@ public void CanGenerateSas_ClientConstructors() GetOptions())); Assert.IsTrue(directory2.CanGenerateSasUri); - // Act - ShareFileClient(Uri blobContainerUri, BlobClientOptions options = default) + // Act - ShareFileClient(Uri ShareContainerUri, ShareClientOptions options = default) ShareFileClient directory3 = InstrumentClient(new ShareFileClient( - blobEndpoint, + ShareEndpoint, GetOptions())); Assert.IsFalse(directory3.CanGenerateSasUri); - // Act - ShareFileClient(Uri blobContainerUri, StorageSharedKeyCredential credential, BlobClientOptions options = default) + // Act - ShareFileClient(Uri ShareContainerUri, StorageSharedKeyCredential credential, ShareClientOptions options = default) ShareFileClient directory4 = InstrumentClient(new ShareFileClient( - blobEndpoint, + ShareEndpoint, constants.Sas.SharedKeyCredential, GetOptions())); Assert.IsTrue(directory4.CanGenerateSasUri); From 6e4d0ec420d48456649cdea1403439abc070b186 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Thu, 11 Jul 2024 22:20:44 -0700 Subject: [PATCH 6/7] Rerecord files tests --- sdk/storage/Azure.Storage.Files.Shares/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/Azure.Storage.Files.Shares/assets.json b/sdk/storage/Azure.Storage.Files.Shares/assets.json index 040738813aa57..99ba7f8bd3322 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.Shares", - "Tag": "net/storage/Azure.Storage.Files.Shares_1665034009" + "Tag": "net/storage/Azure.Storage.Files.Shares_5d0983e6db" } From 31845b0f48420994f751d92b6d9e4fdc110ef73c Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Mon, 15 Jul 2024 10:19:46 -0700 Subject: [PATCH 7/7] Merge and record tests --- sdk/storage/Azure.Storage.Blobs/assets.json | 2 +- sdk/storage/Azure.Storage.Files.DataLake/assets.json | 2 +- sdk/storage/Azure.Storage.Files.Shares/assets.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index 5539b0df43f81..46a74dc97b014 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_63b4909656" + "Tag": "net/storage/Azure.Storage.Blobs_be75b1430c" } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/assets.json b/sdk/storage/Azure.Storage.Files.DataLake/assets.json index 3017e52af2d97..442889d04be63 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_cb6521e860" + "Tag": "net/storage/Azure.Storage.Files.DataLake_186c14971d" } diff --git a/sdk/storage/Azure.Storage.Files.Shares/assets.json b/sdk/storage/Azure.Storage.Files.Shares/assets.json index 99ba7f8bd3322..07a2406439a2a 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.Shares", - "Tag": "net/storage/Azure.Storage.Files.Shares_5d0983e6db" + "Tag": "net/storage/Azure.Storage.Files.Shares_093f14c48d" }