diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs index 402cdb01043ce..f474ebd8a6210 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs @@ -354,11 +354,11 @@ internal BlobAppendInfo() { } private readonly object _dummy; private readonly int _dummyPrimitive; public BlobAudience(string value) { throw null; } - public static Azure.Storage.Blobs.Models.BlobAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobAudience CreateBlobServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Blobs.Models.BlobAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } - public static Azure.Storage.Blobs.Models.BlobAudience GetBlobServiceAccountAudience(string storageAccountName) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Storage.Blobs.Models.BlobAudience left, Azure.Storage.Blobs.Models.BlobAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index 402cdb01043ce..f474ebd8a6210 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -354,11 +354,11 @@ internal BlobAppendInfo() { } private readonly object _dummy; private readonly int _dummyPrimitive; public BlobAudience(string value) { throw null; } - public static Azure.Storage.Blobs.Models.BlobAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobAudience CreateBlobServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Blobs.Models.BlobAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } - public static Azure.Storage.Blobs.Models.BlobAudience GetBlobServiceAccountAudience(string storageAccountName) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Storage.Blobs.Models.BlobAudience left, Azure.Storage.Blobs.Models.BlobAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs index 402cdb01043ce..f474ebd8a6210 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs @@ -354,11 +354,11 @@ internal BlobAppendInfo() { } private readonly object _dummy; private readonly int _dummyPrimitive; public BlobAudience(string value) { throw null; } - public static Azure.Storage.Blobs.Models.BlobAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobAudience CreateBlobServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Blobs.Models.BlobAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } - public static Azure.Storage.Blobs.Models.BlobAudience GetBlobServiceAccountAudience(string storageAccountName) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Storage.Blobs.Models.BlobAudience left, Azure.Storage.Blobs.Models.BlobAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index e0ddbb6044ee9..6eab5e874f601 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -332,7 +332,7 @@ public BlobBaseClient(Uri blobUri, TokenCredential credential, BlobClientOptions : this( blobUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? BlobAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? BlobAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options, storageSharedKeyCredential: null, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs index bac2e18cde80c..8e704c891b481 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs @@ -348,7 +348,7 @@ internal HttpPipeline Build(object credentials) /// /// Gets or sets the Audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. /// - /// If null, will be assumed. + /// If null, will be assumed. public BlobAudience? Audience { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs index 2b86fbbdae2fb..1b8b5e27da5e9 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs @@ -362,7 +362,7 @@ public BlobContainerClient(Uri blobContainerUri, TokenCredential credential, Blo Argument.AssertNotNull(blobContainerUri, nameof(blobContainerUri)); _uri = blobContainerUri; - string audienceScope = string.IsNullOrEmpty(options?.Audience?.ToString()) ? BlobAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(); + string audienceScope = string.IsNullOrEmpty(options?.Audience?.ToString()) ? BlobAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(); _authenticationPolicy = credential.AsPolicy(audienceScope, options); options ??= new BlobClientOptions(); diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs index b198bdb9e9511..6f41d5d209eca 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs @@ -249,7 +249,7 @@ public BlobServiceClient(Uri serviceUri, TokenCredential credential, BlobClientO : this( serviceUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? BlobAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? BlobAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), credential, options ?? new BlobClientOptions()) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobAudience.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobAudience.cs index f6393e7b5806a..b6cad4d1bbe6c 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobAudience.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobAudience.cs @@ -29,7 +29,7 @@ public BlobAudience(string value) _value = value; } - private const string _publicAudience = "https://storage.azure.com/"; + private const string _defaultAudience = "https://storage.azure.com/"; /// /// Default Audience. Use to acquire a token for authorizing requests to any Azure Storage account @@ -38,7 +38,7 @@ public BlobAudience(string value) /// /// If no audience is specified, this is the default value. /// - public static BlobAudience PublicAudience { get; } = new(_publicAudience); + public static BlobAudience DefaultAudience { get; } = new(_defaultAudience); /// /// The service endpoint for a given storage account. @@ -48,7 +48,7 @@ public BlobAudience(string value) /// The storage account name used to populate the service endpoint. /// /// - public static BlobAudience GetBlobServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.blob.core.windows.net/"); + public static BlobAudience CreateBlobServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.blob.core.windows.net/"); /// Determines if two values are the same. public static bool operator ==(BlobAudience left, BlobAudience right) => left.Equals(right); diff --git a/sdk/storage/Azure.Storage.Blobs/tests/AppendBlobClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/AppendBlobClientTests.cs index 487beff6db51f..a9bc35777c398 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/AppendBlobClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/AppendBlobClientTests.cs @@ -166,7 +166,7 @@ public async Task Ctor_DefaultAudience() await blob.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { @@ -222,7 +222,7 @@ public async Task Ctor_StorageAccountAudience() await blob.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.GetBlobServiceAccountAudience(test.Container.AccountName)); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.CreateBlobServiceAccountAudience(test.Container.AccountName)); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index e7c006e0bd277..55b098b043a2f 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -256,7 +256,7 @@ public async Task Ctor_DefaultAudience() } // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { @@ -320,7 +320,7 @@ public async Task Ctor_StorageAccountAudience() } // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.GetBlobServiceAccountAudience(test.Container.AccountName)); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.CreateBlobServiceAccountAudience(test.Container.AccountName)); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { @@ -352,7 +352,7 @@ public async Task Ctor_AudienceError() } // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobClientTests.cs index 8ef1281c1e0c3..9160774784078 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobClientTests.cs @@ -208,7 +208,7 @@ public async Task Ctor_DefaultAudience() } // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { @@ -272,7 +272,7 @@ public async Task Ctor_StorageAccountAudience() } // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.GetBlobServiceAccountAudience(test.Container.AccountName)); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.CreateBlobServiceAccountAudience(test.Container.AccountName)); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs index 8b56ad2a0ca2e..fccaeb6df44b8 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs @@ -336,7 +336,7 @@ public async Task Ctor_DefaultAudience() await using DisposingContainer test = await GetTestContainerAsync(); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { @@ -384,7 +384,7 @@ public async Task Ctor_StorageAccountAudience() await using DisposingContainer test = await GetTestContainerAsync(); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.GetBlobServiceAccountAudience(test.Container.AccountName)); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.CreateBlobServiceAccountAudience(test.Container.AccountName)); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Blobs/tests/PageBlobClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/PageBlobClientTests.cs index 8901ea3c48a4c..52e2550bf828a 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/PageBlobClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/PageBlobClientTests.cs @@ -156,7 +156,7 @@ public async Task Ctor_DefaultAudience() await blob.CreateIfNotExistsAsync(Constants.KB); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { @@ -212,7 +212,7 @@ public async Task Ctor_StorageAccountAudience() await blob.CreateIfNotExistsAsync(Constants.KB); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.GetBlobServiceAccountAudience(test.Container.AccountName)); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.CreateBlobServiceAccountAudience(test.Container.AccountName)); BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs index 3a347a2b2c276..05b25ee26d1ab 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs @@ -179,7 +179,7 @@ public void Ctor_With_Sas_Does_Not_Reorder_Services() public async Task Ctor_DefaultAudience() { // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.PublicAudience); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.DefaultAudience); BlobServiceClient aadService = InstrumentClient(new BlobServiceClient( new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint), @@ -217,7 +217,7 @@ public async Task Ctor_StorageAccountAudience() BlobUriBuilder uriBuilder = new BlobUriBuilder(new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint)); // Act - Create new blob client with the OAuth Credential and Audience - BlobClientOptions options = GetOptionsWithAudience(BlobAudience.GetBlobServiceAccountAudience(uriBuilder.AccountName)); + BlobClientOptions options = GetOptionsWithAudience(BlobAudience.CreateBlobServiceAccountAudience(uriBuilder.AccountName)); BlobServiceClient aadService = InstrumentClient(new BlobServiceClient( new Uri(Tenants.TestConfigOAuth.BlobServiceEndpoint), diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs index 9dc66957a457e..e6e078aa04944 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs @@ -538,8 +538,8 @@ public DataLakeAnalyticsLogging() { } private readonly object _dummy; private readonly int _dummyPrimitive; public DataLakeAudience(string value) { throw null; } - public static Azure.Storage.Files.DataLake.Models.DataLakeAudience PublicAudience { get { throw null; } } - public static Azure.Storage.Files.DataLake.Models.DataLakeAudience DataLakeServiceAccountAudience(string storageAccountName) { throw null; } + public static Azure.Storage.Files.DataLake.Models.DataLakeAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Files.DataLake.Models.DataLakeAudience CreateDataLakeServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Files.DataLake.Models.DataLakeAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs index 9dc66957a457e..e6e078aa04944 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs @@ -538,8 +538,8 @@ public DataLakeAnalyticsLogging() { } private readonly object _dummy; private readonly int _dummyPrimitive; public DataLakeAudience(string value) { throw null; } - public static Azure.Storage.Files.DataLake.Models.DataLakeAudience PublicAudience { get { throw null; } } - public static Azure.Storage.Files.DataLake.Models.DataLakeAudience DataLakeServiceAccountAudience(string storageAccountName) { throw null; } + public static Azure.Storage.Files.DataLake.Models.DataLakeAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Files.DataLake.Models.DataLakeAudience CreateDataLakeServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Files.DataLake.Models.DataLakeAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs index 1bfe42794cc50..101ad32508679 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs @@ -362,7 +362,7 @@ internal HttpPipeline Build(object credentials) /// /// Gets or sets the Audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. /// - /// If null, will be assumed. + /// If null, will be assumed. public DataLakeAudience? Audience { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs index 475ffe865d7d2..3b5a2da29b8c8 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs @@ -244,7 +244,7 @@ public DataLakeDirectoryClient(Uri directoryUri, TokenCredential credential, Dat : this( directoryUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options, tokenCredential: credential) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs index ad92346dbc08b..0692f48a220e5 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs @@ -261,7 +261,7 @@ public DataLakeFileClient(Uri fileUri, TokenCredential credential, DataLakeClien : this( fileUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options, credential) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs index e12cd25fbb185..8eb41cb20c2e7 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs @@ -390,7 +390,7 @@ public DataLakeFileSystemClient(Uri fileSystemUri, TokenCredential credential, D : this( fileSystemUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options, storageSharedKeyCredential: null, diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs index 8ae179ba89be3..2c13895de7e5e 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs @@ -456,7 +456,7 @@ public DataLakePathClient(Uri pathUri, TokenCredential credential, DataLakeClien : this( pathUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options, storageSharedKeyCredential: null, diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeServiceClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeServiceClient.cs index 071bb16ec06ef..7400878b00516 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeServiceClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeServiceClient.cs @@ -316,7 +316,7 @@ public DataLakeServiceClient(Uri serviceUri, TokenCredential credential, DataLak : this( serviceUri, credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? DataLakeAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options, storageSharedKeyCredential:null, diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeAudience.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeAudience.cs index 99e3418c8e922..a3e089e064173 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeAudience.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeAudience.cs @@ -29,7 +29,7 @@ public DataLakeAudience(string value) _value = value; } - private const string _publicAudience = "https://storage.azure.com/"; + private const string _defaultAudience = "https://storage.azure.com/"; /// /// Default Audience. Use to acquire a token for authorizing requests to any Azure Storage account @@ -38,7 +38,7 @@ public DataLakeAudience(string value) /// /// If no audience is specified, this is the default value. /// - public static DataLakeAudience PublicAudience { get; } = new(_publicAudience); + public static DataLakeAudience DefaultAudience { get; } = new(_defaultAudience); /// /// The service endpoint for a given storage account. @@ -48,7 +48,7 @@ public DataLakeAudience(string value) /// The storage account name used to populate the service endpoint. /// /// - public static DataLakeAudience DataLakeServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.blob.core.windows.net/"); + public static DataLakeAudience CreateDataLakeServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.blob.core.windows.net/"); /// Determines if two values are the same. public static bool operator ==(DataLakeAudience left, DataLakeAudience right) => left.Equals(right); diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs index 347dfe198afc0..37ab4c3e9eb85 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs @@ -232,7 +232,7 @@ public async Task Ctor_DefaultAudience() await pathClient.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.PublicAudience); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DefaultAudience); DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) { @@ -288,7 +288,7 @@ public async Task Ctor_StorageAccountAudience() await pathClient.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DataLakeServiceAccountAudience(test.FileSystem.AccountName)); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.CreateDataLakeServiceAccountAudience(test.FileSystem.AccountName)); DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs index 170bb2adae7e4..5befbd6677b90 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs @@ -235,7 +235,7 @@ public async Task Ctor_DefaultAudience() await pathClient.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.PublicAudience); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DefaultAudience); DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) { @@ -291,7 +291,7 @@ public async Task Ctor_StorageAccountAudience() await pathClient.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DataLakeServiceAccountAudience(test.FileSystem.AccountName)); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.CreateDataLakeServiceAccountAudience(test.FileSystem.AccountName)); DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs index 36220d93799da..4ba3de8f09d6c 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs @@ -240,7 +240,7 @@ public async Task Ctor_DefaultAudience() await using DisposingFileSystem test = await GetNewFileSystem(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.PublicAudience); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DefaultAudience); DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) { FileSystemName = test.FileSystem.Name, @@ -287,7 +287,7 @@ public async Task Ctor_StorageAccountAudience() await using DisposingFileSystem test = await GetNewFileSystem(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DataLakeServiceAccountAudience(test.FileSystem.AccountName)); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.CreateDataLakeServiceAccountAudience(test.FileSystem.AccountName)); DataLakeUriBuilder uriBuilder = new DataLakeUriBuilder(new Uri(Tenants.TestConfigHierarchicalNamespace.BlobServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/ServiceClientTests.cs index ed4f37144ec62..eddaab553871e 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/ServiceClientTests.cs @@ -198,7 +198,7 @@ public async Task Ctor_DefaultAudience() DataLakeServiceClient service = DataLakeClientBuilder.GetServiceClient_Hns(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.PublicAudience); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DefaultAudience); DataLakeServiceClient aadServiceClient = InstrumentClient(new DataLakeServiceClient( service.Uri, @@ -236,7 +236,7 @@ public async Task Ctor_StorageAccountAudience() DataLakeServiceClient service = DataLakeClientBuilder.GetServiceClient_Hns(); // Act - Create new blob client with the OAuth Credential and Audience - DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.DataLakeServiceAccountAudience(service.AccountName)); + DataLakeClientOptions options = GetOptionsWithAudience(DataLakeAudience.CreateDataLakeServiceAccountAudience(service.AccountName)); DataLakeServiceClient aadServiceClient = InstrumentClient(new DataLakeServiceClient( service.Uri, diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs index bbe0ea970696f..327a672990a99 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs @@ -519,13 +519,13 @@ public ShareAccessPolicy() { } private readonly object _dummy; private readonly int _dummyPrimitive; public ShareAudience(string value) { throw null; } - public static Azure.Storage.Files.Shares.Models.ShareAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareAudience CreateShareServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Files.Shares.Models.ShareAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static Azure.Storage.Files.Shares.Models.ShareAudience GetShareServiceAccountAudience(string storageAccountName) { throw null; } public static bool operator ==(Azure.Storage.Files.Shares.Models.ShareAudience left, Azure.Storage.Files.Shares.Models.ShareAudience right) { throw null; } public static implicit operator Azure.Storage.Files.Shares.Models.ShareAudience (string value) { throw null; } public static bool operator !=(Azure.Storage.Files.Shares.Models.ShareAudience left, Azure.Storage.Files.Shares.Models.ShareAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs index bbe0ea970696f..327a672990a99 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs @@ -519,13 +519,13 @@ public ShareAccessPolicy() { } private readonly object _dummy; private readonly int _dummyPrimitive; public ShareAudience(string value) { throw null; } - public static Azure.Storage.Files.Shares.Models.ShareAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareAudience DefaultAudience { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareAudience CreateShareServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Files.Shares.Models.ShareAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static Azure.Storage.Files.Shares.Models.ShareAudience GetShareServiceAccountAudience(string storageAccountName) { throw null; } public static bool operator ==(Azure.Storage.Files.Shares.Models.ShareAudience left, Azure.Storage.Files.Shares.Models.ShareAudience right) { throw null; } public static implicit operator Azure.Storage.Files.Shares.Models.ShareAudience (string value) { throw null; } public static bool operator !=(Azure.Storage.Files.Shares.Models.ShareAudience left, Azure.Storage.Files.Shares.Models.ShareAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareAudience.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareAudience.cs index 13f889681180e..d6887cde9caf0 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareAudience.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareAudience.cs @@ -29,7 +29,7 @@ public ShareAudience(string value) _value = value; } - private const string _publicAudience = "https://storage.azure.com/"; + private const string _defaultAudience = "https://storage.azure.com/"; /// /// Default Audience. Use to acquire a token for authorizing requests to any Azure Storage account @@ -38,7 +38,7 @@ public ShareAudience(string value) /// /// If no audience is specified, this is the default value. /// - public static ShareAudience PublicAudience { get; } = new(_publicAudience); + public static ShareAudience DefaultAudience { get; } = new(_defaultAudience); /// /// The service endpoint for a given storage account. @@ -48,7 +48,7 @@ public ShareAudience(string value) /// The storage account name used to populate the service endpoint. /// /// - public static ShareAudience GetShareServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.file.core.windows.net/"); + public static ShareAudience CreateShareServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.file.core.windows.net/"); /// Determines if two values are the same. public static bool operator ==(ShareAudience left, ShareAudience right) => left.Equals(right); diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs index f864c8c173963..8d3406e9bf243 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs @@ -294,7 +294,7 @@ public ShareClient( : this( shareUri: shareUri, authentication: credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options: options ?? new ShareClientOptions(), storageSharedKeyCredential: default, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs index 4b59326f885d6..e2d382ab20503 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs @@ -274,7 +274,7 @@ private void AddHeadersAndQueryParameters() /// /// Gets or sets the Audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. /// - /// If null, will be assumed. + /// If null, will be assumed. public ShareAudience? Audience { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs index e4556b4e40fbe..4b94f5fddc28b 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs @@ -326,7 +326,7 @@ public ShareDirectoryClient( : this( directoryUri: directoryUri, authentication: credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options: options ?? new ShareClientOptions(), storageSharedKeyCredential: null, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs index 4b9542cb10725..c9605b686651e 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs @@ -334,7 +334,7 @@ public ShareFileClient( : this( fileUri: fileUri, authentication: credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options: options ?? new ShareClientOptions(), storageSharedKeyCredential: null, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs index 574a02d49510f..2964593888230 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs @@ -274,7 +274,7 @@ public ShareServiceClient( : this( serviceUri: serviceUri, authentication: credential.AsPolicy( - string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.PublicAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), + string.IsNullOrEmpty(options?.Audience?.ToString()) ? ShareAudience.DefaultAudience.CreateDefaultScope() : options.Audience.Value.CreateDefaultScope(), options), options: options ?? new ShareClientOptions(), sharedKeyCredential: null, diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs index 05d994441734e..b6ca422b6e13f 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs @@ -117,7 +117,7 @@ public async Task Ctor_DefaultAudience() await directoryClient.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(ShareAudience.PublicAudience); + ShareClientOptions options = GetOptionsWithAudience(ShareAudience.DefaultAudience); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { @@ -171,7 +171,7 @@ public async Task Ctor_StorageAccountAudience() await directoryClient.CreateIfNotExistsAsync(); // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(ShareAudience.GetShareServiceAccountAudience(directoryClient.AccountName)); + ShareClientOptions options = GetOptionsWithAudience(ShareAudience.CreateShareServiceAccountAudience(directoryClient.AccountName)); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs index 92a50a1cbf4fe..7bba863f981a1 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs @@ -121,7 +121,7 @@ public async Task Ctor_DefaultAudience() await fileClient.CreateAsync(Constants.KB); // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(ShareAudience.PublicAudience); + ShareClientOptions options = GetOptionsWithAudience(ShareAudience.DefaultAudience); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { @@ -179,7 +179,7 @@ public async Task Ctor_StorageAccountAudience() await fileClient.CreateAsync(Constants.KB); // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(ShareAudience.GetShareServiceAccountAudience(test.Share.AccountName)); + ShareClientOptions options = GetOptionsWithAudience(ShareAudience.CreateShareServiceAccountAudience(test.Share.AccountName)); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs index aa999bde9b198..cfc659905b6da 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs @@ -160,7 +160,7 @@ public async Task Ctor_DefaultAudience() await using DisposingShare test = await GetTestShareAsync(); // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(ShareAudience.PublicAudience); + ShareClientOptions options = GetOptionsWithAudience(ShareAudience.DefaultAudience); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { @@ -210,7 +210,7 @@ public async Task Ctor_StorageAccountAudience() await using DisposingShare test = await GetTestShareAsync(); // Act - Create new blob client with the OAuth Credential and Audience - ShareClientOptions options = GetOptionsWithAudience(ShareAudience.GetShareServiceAccountAudience(test.Share.AccountName)); + ShareClientOptions options = GetOptionsWithAudience(ShareAudience.CreateShareServiceAccountAudience(test.Share.AccountName)); ShareUriBuilder uriBuilder = new ShareUriBuilder(new Uri(Tenants.TestConfigOAuth.FileServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs index 9bdeab729b5a7..3f09403dca248 100644 --- a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs +++ b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs @@ -193,12 +193,12 @@ public QueueAnalyticsLogging() { } private readonly int _dummyPrimitive; public QueueAudience(string value) { throw null; } public static Azure.Storage.Queues.Models.QueueAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Queues.Models.QueueAudience CreateQueueServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Queues.Models.QueueAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static Azure.Storage.Queues.Models.QueueAudience GetQueueServiceAccountAudience(string storageAccountName) { throw null; } public static bool operator ==(Azure.Storage.Queues.Models.QueueAudience left, Azure.Storage.Queues.Models.QueueAudience right) { throw null; } public static implicit operator Azure.Storage.Queues.Models.QueueAudience (string value) { throw null; } public static bool operator !=(Azure.Storage.Queues.Models.QueueAudience left, Azure.Storage.Queues.Models.QueueAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs index 9bdeab729b5a7..3f09403dca248 100644 --- a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs @@ -193,12 +193,12 @@ public QueueAnalyticsLogging() { } private readonly int _dummyPrimitive; public QueueAudience(string value) { throw null; } public static Azure.Storage.Queues.Models.QueueAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Queues.Models.QueueAudience CreateQueueServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Queues.Models.QueueAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static Azure.Storage.Queues.Models.QueueAudience GetQueueServiceAccountAudience(string storageAccountName) { throw null; } public static bool operator ==(Azure.Storage.Queues.Models.QueueAudience left, Azure.Storage.Queues.Models.QueueAudience right) { throw null; } public static implicit operator Azure.Storage.Queues.Models.QueueAudience (string value) { throw null; } public static bool operator !=(Azure.Storage.Queues.Models.QueueAudience left, Azure.Storage.Queues.Models.QueueAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.1.cs b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.1.cs index 9bdeab729b5a7..3f09403dca248 100644 --- a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.1.cs @@ -193,12 +193,12 @@ public QueueAnalyticsLogging() { } private readonly int _dummyPrimitive; public QueueAudience(string value) { throw null; } public static Azure.Storage.Queues.Models.QueueAudience PublicAudience { get { throw null; } } + public static Azure.Storage.Queues.Models.QueueAudience CreateQueueServiceAccountAudience(string storageAccountName) { throw null; } public bool Equals(Azure.Storage.Queues.Models.QueueAudience other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static Azure.Storage.Queues.Models.QueueAudience GetQueueServiceAccountAudience(string storageAccountName) { throw null; } public static bool operator ==(Azure.Storage.Queues.Models.QueueAudience left, Azure.Storage.Queues.Models.QueueAudience right) { throw null; } public static implicit operator Azure.Storage.Queues.Models.QueueAudience (string value) { throw null; } public static bool operator !=(Azure.Storage.Queues.Models.QueueAudience left, Azure.Storage.Queues.Models.QueueAudience right) { throw null; } diff --git a/sdk/storage/Azure.Storage.Queues/src/Models/QueueAudience.cs b/sdk/storage/Azure.Storage.Queues/src/Models/QueueAudience.cs index fa92c17aa1c3c..00668b39fb1ba 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Models/QueueAudience.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Models/QueueAudience.cs @@ -29,7 +29,7 @@ public QueueAudience(string value) _value = value; } - private const string _publicAudience = "https://storage.azure.com/"; + private const string _defaultAudience = "https://storage.azure.com/"; /// /// Default Audience. Use to acquire a token for authorizing requests to any Azure Storage account @@ -38,7 +38,7 @@ public QueueAudience(string value) /// /// If no audience is specified, this is the default value. /// - public static QueueAudience PublicAudience { get; } = new(_publicAudience); + public static QueueAudience PublicAudience { get; } = new(_defaultAudience); /// /// The service endpoint for a given storage account. @@ -48,7 +48,7 @@ public QueueAudience(string value) /// The storage account name used to populate the service endpoint. /// /// - public static QueueAudience GetQueueServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.queue.core.windows.net/"); + public static QueueAudience CreateQueueServiceAccountAudience(string storageAccountName) => new($"https://{storageAccountName}.queue.core.windows.net/"); /// Determines if two values are the same. public static bool operator ==(QueueAudience left, QueueAudience right) => left.Equals(right); diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueClientTests.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueClientTests.cs index 0c99071c7d8c7..3dbc4c7ae8821 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueClientTests.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueClientTests.cs @@ -220,7 +220,7 @@ public async Task Ctor_StorageAccountAudience() await using DisposingQueue test = await GetTestQueueAsync(); // Act - Create new blob client with the OAuth Credential and Audience - QueueClientOptions options = GetOptionsWithAudience(QueueAudience.GetQueueServiceAccountAudience(test.Queue.AccountName)); + QueueClientOptions options = GetOptionsWithAudience(QueueAudience.CreateQueueServiceAccountAudience(test.Queue.AccountName)); QueueUriBuilder uriBuilder = new QueueUriBuilder(new Uri(Tenants.TestConfigOAuth.QueueServiceEndpoint)) { diff --git a/sdk/storage/Azure.Storage.Queues/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Queues/tests/ServiceClientTests.cs index 9f00fbe5c5a41..3523c6c8c1999 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/ServiceClientTests.cs @@ -149,7 +149,7 @@ public async Task Ctor_StorageAccountAudience() QueueUriBuilder uriBuilder = new QueueUriBuilder(new Uri(Tenants.TestConfigOAuth.QueueServiceEndpoint)); // Act - Create new Queue client with the OAuth Credential and Audience - QueueClientOptions options = GetOptionsWithAudience(QueueAudience.GetQueueServiceAccountAudience(uriBuilder.AccountName)); + QueueClientOptions options = GetOptionsWithAudience(QueueAudience.CreateQueueServiceAccountAudience(uriBuilder.AccountName)); QueueServiceClient aadService = InstrumentClient(new QueueServiceClient( new Uri(Tenants.TestConfigOAuth.QueueServiceEndpoint),