From 52bbb5642b69267070082b03ca5af404e623bac5 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sat, 14 Sep 2024 15:21:37 +0900 Subject: [PATCH 01/11] update AddGetAdminEvent Related to: #208 --- .../Endpoints/AdminEventEndpoints.cs | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs index 2687693f..1555a72a 100644 --- a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs +++ b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs @@ -107,12 +107,33 @@ public static RouteHandlerBuilder AddGetAdminEvent(this WebApplication app) { // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19 // Need authorization by admin - var builder = app.MapGet(AdminEndpointUrls.AdminEventDetails, ( - [FromRoute] string eventId) => + var builder = app.MapGet(AdminEndpointUrls.AdminEventDetails, async ( + [FromRoute] string eventId, + IAdminEventService service, + ILoggerFactory loggerFactory) => { - // Todo: Issue #208 https://github.com/aliencube/azure-openai-sdk-proxy/issues/208 - return Results.Ok(); - // Todo: Issue #208 + var logger = loggerFactory.CreateLogger(nameof(AdminEventEndpoints)); + logger.LogInformation($"Received request to fetch details for event with ID: {eventId}"); + + if(Guid.TryParse(eventId, out _)) + { + logger.LogError($"{eventId} is not in a valid GUID format"); + return Results.NotFound(); + } + + try + { + var details = await service.GetEvent(Guid.Parse(eventId)); + return details is null ? Results.NotFound() : Results.Ok(details); + } + catch(Exception ex) + { + // TODO: 발생 가능한 exception 별로 다르게 처리할 필요가 있는지 검토 + logger.LogError(ex, $"Failed to get event details of ${eventId}"); + + return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError); + } + }) .Produces(statusCode: StatusCodes.Status200OK, contentType: "application/json") .Produces(statusCode: StatusCodes.Status401Unauthorized) From 25668e9d8c72c0199ba5596e5846d950993e0829 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sat, 14 Sep 2024 15:25:39 +0900 Subject: [PATCH 02/11] inject TableServiceClient to AdminEventRepository Related to: #208 --- .../Repositories/AdminEventRepository.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs index 552b6416..e470f187 100644 --- a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs +++ b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs @@ -1,4 +1,6 @@ -using AzureOpenAIProxy.ApiApp.Models; +using Azure.Data.Tables; + +using AzureOpenAIProxy.ApiApp.Models; namespace AzureOpenAIProxy.ApiApp.Repositories; @@ -39,8 +41,10 @@ public interface IAdminEventRepository /// /// This represents the repository entity for the admin event. /// -public class AdminEventRepository : IAdminEventRepository +public class AdminEventRepository(TableServiceClient tableServiceClient) : IAdminEventRepository { + private readonly TableServiceClient _tableServiceClient = tableServiceClient ?? throw new ArgumentNullException(nameof(tableServiceClient)); + /// public async Task CreateEvent(AdminEventDetails eventDetails) { From 136b6c0f6f18ab727d868675d15a6bce17493034 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sat, 21 Sep 2024 23:25:18 +0900 Subject: [PATCH 03/11] update AdminEventEndpoints Related to: #208 --- .../Endpoints/AdminEventEndpoints.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs index 1555a72a..169e9a88 100644 --- a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs +++ b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs @@ -108,32 +108,24 @@ public static RouteHandlerBuilder AddGetAdminEvent(this WebApplication app) // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19 // Need authorization by admin var builder = app.MapGet(AdminEndpointUrls.AdminEventDetails, async ( - [FromRoute] string eventId, + [FromRoute] Guid eventId, IAdminEventService service, ILoggerFactory loggerFactory) => { var logger = loggerFactory.CreateLogger(nameof(AdminEventEndpoints)); logger.LogInformation($"Received request to fetch details for event with ID: {eventId}"); - if(Guid.TryParse(eventId, out _)) - { - logger.LogError($"{eventId} is not in a valid GUID format"); - return Results.NotFound(); - } - try { - var details = await service.GetEvent(Guid.Parse(eventId)); + var details = await service.GetEvent(eventId); return details is null ? Results.NotFound() : Results.Ok(details); } catch(Exception ex) { - // TODO: 발생 가능한 exception 별로 다르게 처리할 필요가 있는지 검토 logger.LogError(ex, $"Failed to get event details of ${eventId}"); return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError); } - }) .Produces(statusCode: StatusCodes.Status200OK, contentType: "application/json") .Produces(statusCode: StatusCodes.Status401Unauthorized) From 245d06bf73c3384f4c776b4009633f8a7da98747 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sat, 21 Sep 2024 23:57:13 +0900 Subject: [PATCH 04/11] update AdminEventRepository Related to: #208 --- .../Endpoints/AdminEventEndpoints.cs | 11 +++++++++-- .../Repositories/AdminEventRepository.cs | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs index 169e9a88..bb4b61e2 100644 --- a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs +++ b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs @@ -1,3 +1,5 @@ +using Azure; + using AzureOpenAIProxy.ApiApp.Models; using AzureOpenAIProxy.ApiApp.Services; @@ -118,11 +120,16 @@ public static RouteHandlerBuilder AddGetAdminEvent(this WebApplication app) try { var details = await service.GetEvent(eventId); - return details is null ? Results.NotFound() : Results.Ok(details); + return Results.Ok(details); + } + catch(RequestFailedException ex) + { + logger.LogError($"Failed to get event details of ${eventId}"); + return Results.NotFound(); } catch(Exception ex) { - logger.LogError(ex, $"Failed to get event details of ${eventId}"); + logger.LogError(ex, $"Error occurred while fetching event details of ${eventId}"); return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError); } diff --git a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs index 4881da1c..6252386e 100644 --- a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs +++ b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs @@ -63,7 +63,14 @@ public async Task> GetEvents() /// public async Task GetEvent(Guid eventId) { - throw new NotImplementedException(); + TableClient tableClient = _tableServiceClient.GetTableClient(_storageAccountSettings.TableStorage.TableName); + + var eventDetail = await tableClient.GetEntityAsync( + rowKey: eventId.ToString(), + partitionKey: "event-details" + ).ConfigureAwait(false); + + return eventDetail; } /// From 38d19e78fee7cb2331c1ef4aff7005208d697fc3 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sun, 22 Sep 2024 16:22:03 +0900 Subject: [PATCH 05/11] update GetEvent implements Add codes for handling where the table does not exist Add codes for handling 404 error Related to: #208 --- .../Endpoints/AdminEventEndpoints.cs | 13 +++++++++---- .../Repositories/AdminEventRepository.cs | 11 ++++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs index bb4b61e2..b877754b 100644 --- a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs +++ b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs @@ -124,13 +124,18 @@ public static RouteHandlerBuilder AddGetAdminEvent(this WebApplication app) } catch(RequestFailedException ex) { - logger.LogError($"Failed to get event details of ${eventId}"); - return Results.NotFound(); + if(ex.Status == 404) + { + logger.LogError($"Failed to get event details of {eventId}"); + return Results.NotFound(); + } + + logger.LogError(ex, $"Error occurred while fetching event details of {eventId} with status {ex.Status}"); + return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError); } catch(Exception ex) { - logger.LogError(ex, $"Error occurred while fetching event details of ${eventId}"); - + logger.LogError(ex, $"Error occurred while fetching event details of {eventId}"); return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError); } }) diff --git a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs index 6252386e..95a7d29b 100644 --- a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs +++ b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs @@ -63,7 +63,7 @@ public async Task> GetEvents() /// public async Task GetEvent(Guid eventId) { - TableClient tableClient = _tableServiceClient.GetTableClient(_storageAccountSettings.TableStorage.TableName); + TableClient tableClient = await GetTableClientAsync(); var eventDetail = await tableClient.GetEntityAsync( rowKey: eventId.ToString(), @@ -78,6 +78,15 @@ public async Task UpdateEvent(Guid eventId, AdminEventDetails { throw new NotImplementedException(); } + + private async Task GetTableClientAsync() + { + TableClient tableClient = _tableServiceClient.GetTableClient(_storageAccountSettings.TableStorage.TableName); + + await tableClient.CreateIfNotExistsAsync(); + + return tableClient; + } } /// From 1ae44ad0a130b86a1f14bf07a2b30cfe21497b72 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sun, 22 Sep 2024 17:41:46 +0900 Subject: [PATCH 06/11] add repository tests Related to: #208 --- .../Repositories/AdminEventRepositoryTests.cs | 53 ++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/test/AzureOpenAIProxy.ApiApp.Tests/Repositories/AdminEventRepositoryTests.cs b/test/AzureOpenAIProxy.ApiApp.Tests/Repositories/AdminEventRepositoryTests.cs index 33755e47..ddc0facd 100644 --- a/test/AzureOpenAIProxy.ApiApp.Tests/Repositories/AdminEventRepositoryTests.cs +++ b/test/AzureOpenAIProxy.ApiApp.Tests/Repositories/AdminEventRepositoryTests.cs @@ -1,16 +1,16 @@ -using Azure.Data.Tables; +using Azure; +using Azure.Data.Tables; using AzureOpenAIProxy.ApiApp.Configurations; using AzureOpenAIProxy.ApiApp.Models; using AzureOpenAIProxy.ApiApp.Repositories; -using Castle.Core.Configuration; - using FluentAssertions; using Microsoft.Extensions.DependencyInjection; using NSubstitute; +using NSubstitute.ExceptionExtensions; namespace AzureOpenAIProxy.ApiApp.Tests.Repositories; @@ -88,8 +88,10 @@ public void Given_Instance_When_GetEvents_Invoked_Then_It_Should_Throw_Exception func.Should().ThrowAsync(); } - [Fact] - public void Given_Instance_When_GetEvent_Invoked_Then_It_Should_Throw_Exception() + [Theory] + [InlineData(404)] + [InlineData(500)] + public async Task Given_Failure_In_Get_Entity_When_GetEvent_Invoked_Then_It_Should_Throw_Exception(int statusCode) { // Arrange var settings = Substitute.For(); @@ -97,11 +99,48 @@ public void Given_Instance_When_GetEvent_Invoked_Then_It_Should_Throw_Exception( var eventId = Guid.NewGuid(); var repository = new AdminEventRepository(tableServiceClient, settings); + var exception = new RequestFailedException(statusCode, "Request Error", default, default); + + var tableClient = Substitute.For(); + tableServiceClient.GetTableClient(Arg.Any()).Returns(tableClient); + tableClient.GetEntityAsync(Arg.Any(), Arg.Any()) + .ThrowsAsync(exception); + // Act - Func func = async () => await repository.GetEvent(eventId); + Func func = () => repository.GetEvent(eventId); // Assert - func.Should().ThrowAsync(); + var assertion = await func.Should().ThrowAsync(); + assertion.Which.Status.Should().Be(statusCode); + } + + [Theory] + [InlineData("c355cc28-d847-4637-aad9-2f03d39aa51f", "event-details")] + public async Task Given_Exist_EventId_When_GetEvent_Invoked_Then_It_Should_Return_AdminEventDetails(string eventId, string partitionKey) + { + // Arrange + var settings = Substitute.For(); + var tableServiceClient = Substitute.For(); + var repository = new AdminEventRepository(tableServiceClient, settings); + + var eventDetails = new AdminEventDetails + { + RowKey = eventId, + PartitionKey = partitionKey + }; + + var response = Response.FromValue(eventDetails, Substitute.For()); + + var tableClient = Substitute.For(); + tableServiceClient.GetTableClient(Arg.Any()).Returns(tableClient); + tableClient.GetEntityAsync(partitionKey, eventId) + .Returns(Task.FromResult(response)); + + // Act + var result = await repository.GetEvent(Guid.Parse(eventId)); + + // Assert + result.Should().BeEquivalentTo(eventDetails); } [Fact] From 70af30c022d1ba6215fb01972ea852df41223be1 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Sun, 22 Sep 2024 18:28:25 +0900 Subject: [PATCH 07/11] add service tests Related to: #208 --- .../Endpoints/AdminEventEndpoints.cs | 2 +- .../Repositories/AdminEventRepository.cs | 2 +- .../Services/AdminEventServiceTests.cs | 47 +++++++++++++++++-- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs index b877754b..518c68c5 100644 --- a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs +++ b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs @@ -120,7 +120,7 @@ public static RouteHandlerBuilder AddGetAdminEvent(this WebApplication app) try { var details = await service.GetEvent(eventId); - return Results.Ok(details); + return details is null? Results.NotFound(): Results.Ok(details); } catch(RequestFailedException ex) { diff --git a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs index 95a7d29b..137c2ec8 100644 --- a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs +++ b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs @@ -70,7 +70,7 @@ public async Task GetEvent(Guid eventId) partitionKey: "event-details" ).ConfigureAwait(false); - return eventDetail; + return eventDetail.Value; } /// diff --git a/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs b/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs index cf56f8e2..2b82386c 100644 --- a/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs +++ b/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs @@ -1,12 +1,17 @@ -using AzureOpenAIProxy.ApiApp.Models; +using Azure; + +using AzureOpenAIProxy.ApiApp.Models; using AzureOpenAIProxy.ApiApp.Repositories; using AzureOpenAIProxy.ApiApp.Services; using FluentAssertions; +using Google.Protobuf.WellKnownTypes; + using Microsoft.Extensions.DependencyInjection; using NSubstitute; +using NSubstitute.ExceptionExtensions; namespace AzureOpenAIProxy.ApiApp.Tests.Services; @@ -54,19 +59,51 @@ public void Given_Instance_When_GetEvents_Invoked_Then_It_Should_Throw_Exception func.Should().ThrowAsync(); } - [Fact] - public void Given_Instance_When_GetEvent_Invoked_Then_It_Should_Throw_Exception() + + [Theory] + [InlineData(404)] + [InlineData(500)] + public async Task Given_Failure_In_Get_Entity_When_GetEvent_Invoked_Then_It_Should_Throw_Exception(int statusCode) { // Arrange var eventId = Guid.NewGuid(); var repository = Substitute.For(); var service = new AdminEventService(repository); + var exception = new RequestFailedException(statusCode, "Request Failed", default, default); + + repository.GetEvent(Arg.Any()).ThrowsAsync(exception); + // Act - Func func = async () => await service.GetEvent(eventId); + Func func = () => service.GetEvent(eventId); // Assert - func.Should().ThrowAsync(); + var assertion = await func.Should().ThrowAsync(); + assertion.Which.Status.Should().Be(statusCode); + } + + [Theory] + [InlineData("c355cc28-d847-4637-aad9-2f03d39aa51f")] + public async Task Given_Exist_EventId_When_GetEvent_Invoked_Then_It_Should_Return_AdminEventDetails(string eventId) + { + // Arrange + var repository = Substitute.For(); + var service = new AdminEventService(repository); + + var eventDetails = new AdminEventDetails + { + RowKey = eventId + }; + + var guid = Guid.Parse(eventId); + + repository.GetEvent(guid).Returns(Task.FromResult(eventDetails)); + + // Act + var result = await service.GetEvent(guid); + + // Assert + result.Should().BeEquivalentTo(eventDetails); } [Fact] From b94aae4a43e1f665c77f0d59ef30fe599624f720 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Mon, 23 Sep 2024 15:01:48 +0900 Subject: [PATCH 08/11] remove unnecessary using Related to: #208 --- .../Services/AdminEventServiceTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs b/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs index 2b82386c..f0442c76 100644 --- a/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs +++ b/test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs @@ -6,8 +6,6 @@ using FluentAssertions; -using Google.Protobuf.WellKnownTypes; - using Microsoft.Extensions.DependencyInjection; using NSubstitute; From 9ca3b27a285e25446e476058d49e57aa79faa346 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Mon, 23 Sep 2024 15:04:59 +0900 Subject: [PATCH 09/11] remove unnecessary condition state Related to: #208 --- src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs index 518c68c5..b877754b 100644 --- a/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs +++ b/src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs @@ -120,7 +120,7 @@ public static RouteHandlerBuilder AddGetAdminEvent(this WebApplication app) try { var details = await service.GetEvent(eventId); - return details is null? Results.NotFound(): Results.Ok(details); + return Results.Ok(details); } catch(RequestFailedException ex) { From 537cebc84ccf559029fd490b0e9d68753d060029 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Mon, 23 Sep 2024 15:16:44 +0900 Subject: [PATCH 10/11] add PartitonKeys Related to: #208 --- src/AzureOpenAIProxy.ApiApp/PartitionKeys.cs | 17 +++++++++++++++++ .../Repositories/AdminEventRepository.cs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/AzureOpenAIProxy.ApiApp/PartitionKeys.cs diff --git a/src/AzureOpenAIProxy.ApiApp/PartitionKeys.cs b/src/AzureOpenAIProxy.ApiApp/PartitionKeys.cs new file mode 100644 index 00000000..1949fd7e --- /dev/null +++ b/src/AzureOpenAIProxy.ApiApp/PartitionKeys.cs @@ -0,0 +1,17 @@ +namespace AzureOpenAIProxy.ApiApp; + +/// +/// This represents the partition keys for azure table storage +/// +public class PartitionKeys +{ + /// + /// Partition key for event details + /// + public const string EventDetails = "event-details"; + + /// + /// Partition key for resource details + /// + public const string ResourceDetails = "resource-details"; +} \ No newline at end of file diff --git a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs index 137c2ec8..4b8b9bfb 100644 --- a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs +++ b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs @@ -67,7 +67,7 @@ public async Task GetEvent(Guid eventId) var eventDetail = await tableClient.GetEntityAsync( rowKey: eventId.ToString(), - partitionKey: "event-details" + partitionKey: PartitionKeys.EventDetails ).ConfigureAwait(false); return eventDetail.Value; From 2f4ae055f2147b4a69fbbad2a58dfcbb4c0be7a6 Mon Sep 17 00:00:00 2001 From: sikutisa Date: Mon, 23 Sep 2024 15:25:41 +0900 Subject: [PATCH 11/11] add ConfigureAwait(false) Related to: #208 --- .../Repositories/AdminEventRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs index 4b8b9bfb..1ef0dfcb 100644 --- a/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs +++ b/src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs @@ -83,7 +83,7 @@ private async Task GetTableClientAsync() { TableClient tableClient = _tableServiceClient.GetTableClient(_storageAccountSettings.TableStorage.TableName); - await tableClient.CreateIfNotExistsAsync(); + await tableClient.CreateIfNotExistsAsync().ConfigureAwait(false); return tableClient; }