From 34a80c138a8c7c252fd838401e5e0d0139f5f250 Mon Sep 17 00:00:00 2001 From: joelhulen Date: Tue, 27 Feb 2024 18:05:58 -0500 Subject: [PATCH] Remove additional default credential calls --- .../Common/Services/Azure/AzureResourceManagerService.cs | 2 -- .../Services/ContentSources/ContentSourceServiceFactory.cs | 3 --- .../Services/AzureAISearchIndexingServiceTests.cs | 3 ++- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/dotnet/Common/Services/Azure/AzureResourceManagerService.cs b/src/dotnet/Common/Services/Azure/AzureResourceManagerService.cs index 912efb1fff..b5529d0567 100644 --- a/src/dotnet/Common/Services/Azure/AzureResourceManagerService.cs +++ b/src/dotnet/Common/Services/Azure/AzureResourceManagerService.cs @@ -17,10 +17,8 @@ namespace FoundationaLLM.Common.Services.Azure /// /// Provides services to interact with the Azure Resource Manager (ARM) infrastructure. /// - /// The providing details about the environment. /// The logger used for logging. public class AzureResourceManagerService( - IHostEnvironment environment, ILogger logger) : IAzureResourceManagerService { private readonly ArmClient _armClient = new(DefaultAuthentication.GetAzureCredential()); diff --git a/src/dotnet/Vectorization/Services/ContentSources/ContentSourceServiceFactory.cs b/src/dotnet/Vectorization/Services/ContentSources/ContentSourceServiceFactory.cs index d29fe83a72..cd4c8d50a1 100644 --- a/src/dotnet/Vectorization/Services/ContentSources/ContentSourceServiceFactory.cs +++ b/src/dotnet/Vectorization/Services/ContentSources/ContentSourceServiceFactory.cs @@ -21,17 +21,14 @@ namespace FoundationaLLM.Vectorization.Services.ContentSources /// /// The vectorization resource provider service. /// The global configuration provider. - /// The hosting environment. /// The logger factory used to create loggers. public class ContentSourceServiceFactory( [FromKeyedServices(DependencyInjectionKeys.FoundationaLLM_ResourceProvider_Vectorization)] IResourceProviderService vectorizationResourceProviderService, IConfiguration configuration, - IHostEnvironment environment, ILoggerFactory loggerFactory) : IVectorizationServiceFactory { private readonly IResourceProviderService _vectorizationResourceProviderService = vectorizationResourceProviderService; private readonly IConfiguration _configuration = configuration; - private readonly IHostEnvironment _environment = environment; private readonly ILoggerFactory _loggerFactory = loggerFactory; /// diff --git a/tests/dotnet/SemanticKernel.Tests/Services/AzureAISearchIndexingServiceTests.cs b/tests/dotnet/SemanticKernel.Tests/Services/AzureAISearchIndexingServiceTests.cs index e4dbb90e45..0a16a465d0 100644 --- a/tests/dotnet/SemanticKernel.Tests/Services/AzureAISearchIndexingServiceTests.cs +++ b/tests/dotnet/SemanticKernel.Tests/Services/AzureAISearchIndexingServiceTests.cs @@ -9,6 +9,7 @@ using Azure.Search.Documents.Indexes.Models; using SemanticKernel.Tests.Models; using FoundationaLLM.Common.Models.TextEmbedding; +using FoundationaLLM.Common.Authentication; namespace FoundationaLLM.SemanticKernel.Tests.Services { @@ -23,7 +24,7 @@ public AzureAISearchIndexingServiceTests() var endpoint = Environment.GetEnvironmentVariable("AzureAISearchIndexingServiceTestsSearchEndpoint") ?? ""; _searchIndexClient = new SearchIndexClient( new Uri(endpoint), - new DefaultAzureCredential() + DefaultAuthentication.GetAzureCredential() ); _indexingService = new AzureAISearchIndexingService( Options.Create(