From 572df9ed30ae5dd073d22651340a7a41f2b6b33a Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Wed, 30 Jul 2025 19:51:16 +0530 Subject: [PATCH 1/8] [DKM] Use ManagedIdentityCredential Instead of DefaultAzureCredential Across Repositories --- .../AppConfiguration/AppConfiguration.cs | 3 +- .../Helpers/azure_credential_utils.cs | 31 +++++++++++++++++++ App/kernel-memory/Directory.Packages.props | 2 +- App/kernel-memory/Helpers/Helpers.csproj | 14 +++++++++ .../Helpers/azure_credential_utils.cs | 29 +++++++++++++++++ .../AzureAIDocIntel/AzureAIDocIntel.csproj | 9 +++--- .../AzureAIDocIntel/AzureAIDocIntelEngine.cs | 4 ++- .../AzureAISearch/AzureAISearch.csproj | 1 + .../AzureAISearch/AzureAISearchMemory.cs | 3 +- .../extensions/AzureBlobs/AzureBlobs.csproj | 1 + .../AzureBlobs/AzureBlobsStorage.cs | 3 +- .../extensions/AzureOpenAI/AzureOpenAI.csproj | 1 + .../AzureOpenAITextEmbeddingGenerator.cs | 3 +- .../AzureOpenAI/AzureOpenAITextGenerator.cs | 3 +- .../extensions/AzureQueues/AzureQueues.csproj | 1 + .../AzureQueues/AzureQueuesPipeline.cs | 3 +- App/kernel-memory/service/Service/Program.cs | 4 ++- 17 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs create mode 100644 App/kernel-memory/Helpers/Helpers.csproj create mode 100644 App/kernel-memory/Helpers/azure_credential_utils.cs diff --git a/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs b/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs index 5bd0dc92..15c03131 100644 --- a/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs +++ b/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs @@ -1,6 +1,7 @@ using Azure.Identity; using Microsoft.Extensions.Azure; using Microsoft.GS.DPSHost.AppConfiguration; +using Microsoft.GS.DPSHost.Helpers; namespace Microsoft.GS.DPSHost.AppConfiguration { @@ -16,7 +17,7 @@ public static void Config(IHostApplicationBuilder builder) //Read AppConfiguration with managed Identity builder.Configuration.AddAzureAppConfiguration(options => { - options.Connect(new Uri(builder.Configuration["ConnectionStrings:AppConfig"]), new DefaultAzureCredential()); + options.Connect(new Uri(builder.Configuration["ConnectionStrings:AppConfig"]), AzureCredentialHelper.GetAzureCredential()); }); //Read ServiceConfiguration diff --git a/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs b/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs new file mode 100644 index 00000000..2bda3ee9 --- /dev/null +++ b/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs @@ -0,0 +1,31 @@ +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; + +namespace Microsoft.GS.DPSHost.Helpers +{ + public static class AzureCredentialHelper + { + public static TokenCredential GetAzureCredential(string clientId = null) + { + var env = Environment.GetEnvironmentVariable("APP_ENV") ?? "prod"; + + if (string.Equals(env, "dev", StringComparison.OrdinalIgnoreCase)) + { + return new DefaultAzureCredential(); // For local development + } + else + { + return clientId != null + ? new ManagedIdentityCredential(clientId) + : new ManagedIdentityCredential(); + } + } + + public static Task GetAzureCredentialAsync(string clientId = null) + { + return Task.FromResult(GetAzureCredential(clientId)); + } + } +} diff --git a/App/kernel-memory/Directory.Packages.props b/App/kernel-memory/Directory.Packages.props index 3f6e364b..670d633b 100644 --- a/App/kernel-memory/Directory.Packages.props +++ b/App/kernel-memory/Directory.Packages.props @@ -7,7 +7,7 @@ - + diff --git a/App/kernel-memory/Helpers/Helpers.csproj b/App/kernel-memory/Helpers/Helpers.csproj new file mode 100644 index 00000000..4296f400 --- /dev/null +++ b/App/kernel-memory/Helpers/Helpers.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/App/kernel-memory/Helpers/azure_credential_utils.cs b/App/kernel-memory/Helpers/azure_credential_utils.cs new file mode 100644 index 00000000..6fa6ab30 --- /dev/null +++ b/App/kernel-memory/Helpers/azure_credential_utils.cs @@ -0,0 +1,29 @@ +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +namespace Helpers; + +public static class azure_credential_utils +{ + public static TokenCredential GetAzureCredential(string clientId = null) + { + var env = Environment.GetEnvironmentVariable("APP_ENV") ?? "prod"; + + if (string.Equals(env, "dev", StringComparison.OrdinalIgnoreCase)) + { + return new DefaultAzureCredential(); // For local development + } + else + { + return clientId != null + ? new ManagedIdentityCredential(clientId) + : new ManagedIdentityCredential(); + } + } + + public static Task GetAzureCredentialAsync(string clientId = null) + { + return Task.FromResult(GetAzureCredential(clientId)); + } +} diff --git a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntel.csproj b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntel.csproj index f309652d..7ef4208a 100644 --- a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntel.csproj +++ b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntel.csproj @@ -8,10 +8,6 @@ $(NoWarn);KMEXP02;CA1724;CA1308; - - - - @@ -30,4 +26,9 @@ + + + + + diff --git a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs index 49f3c2a7..cf8d1fdf 100644 --- a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs +++ b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs @@ -8,9 +8,11 @@ using Azure; using Azure.AI.FormRecognizer.DocumentAnalysis; using Azure.Identity; +using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.Diagnostics; + namespace Microsoft.KernelMemory.DataFormats.AzureAIDocIntel; /// @@ -36,7 +38,7 @@ public AzureAIDocIntelEngine( switch (config.Auth) { case AzureAIDocIntelConfig.AuthTypes.AzureIdentity: - this._recognizerClient = new DocumentAnalysisClient(new Uri(config.Endpoint), new DefaultAzureCredential()); + this._recognizerClient = new DocumentAnalysisClient(new Uri(config.Endpoint), azure_credential_utils.GetAzureCredential()); break; case AzureAIDocIntelConfig.AuthTypes.APIKey: diff --git a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearch.csproj b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearch.csproj index c4126a22..39fa86d0 100644 --- a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearch.csproj +++ b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearch.csproj @@ -9,6 +9,7 @@ + diff --git a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs index 07dfde26..7190a15c 100644 --- a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs +++ b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs @@ -14,6 +14,7 @@ using Azure.Search.Documents.Indexes; using Azure.Search.Documents.Indexes.Models; using Azure.Search.Documents.Models; +using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.AI; using Microsoft.KernelMemory.Diagnostics; @@ -66,7 +67,7 @@ public AzureAISearchMemory( case AzureAISearchConfig.AuthTypes.AzureIdentity: this._adminClient = new SearchIndexClient( new Uri(config.Endpoint), - new DefaultAzureCredential(), + azure_credential_utils.GetAzureCredential(), GetClientOptions()); break; diff --git a/App/kernel-memory/extensions/AzureBlobs/AzureBlobs.csproj b/App/kernel-memory/extensions/AzureBlobs/AzureBlobs.csproj index cded11be..07d5694e 100644 --- a/App/kernel-memory/extensions/AzureBlobs/AzureBlobs.csproj +++ b/App/kernel-memory/extensions/AzureBlobs/AzureBlobs.csproj @@ -9,6 +9,7 @@ + diff --git a/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs b/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs index 993bc2a8..03b4b8b8 100644 --- a/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs +++ b/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs @@ -11,6 +11,7 @@ using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; using Azure.Storage.Blobs.Specialized; +using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.Diagnostics; using Microsoft.KernelMemory.Pipeline; @@ -61,7 +62,7 @@ public AzureBlobsStorage( { this.ValidateAccountName(config.Account); var suffix = this.ValidateEndpointSuffix(config.EndpointSuffix); - client = new BlobServiceClient(new Uri($"https://{config.Account}.blob.{suffix}"), new DefaultAzureCredential()); + client = new BlobServiceClient(new Uri($"https://{config.Account}.blob.{suffix}"), azure_credential_utils.GetAzureCredential()); break; } diff --git a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAI.csproj b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAI.csproj index b3163ddd..5fea3398 100644 --- a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAI.csproj +++ b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAI.csproj @@ -9,6 +9,7 @@ + diff --git a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs index 4e1ca1e5..75c42b91 100644 --- a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs +++ b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Identity; +using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.AI.OpenAI; using Microsoft.KernelMemory.Diagnostics; @@ -52,7 +53,7 @@ public AzureOpenAITextEmbeddingGenerator( this._client = new AzureOpenAITextEmbeddingGenerationService( deploymentName: config.Deployment, endpoint: config.Endpoint, - credential: new DefaultAzureCredential(), + credential: azure_credential_utils.GetAzureCredential(), modelId: config.Deployment, httpClient: httpClient, dimensions: config.EmbeddingDimensions, diff --git a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs index bd0a1b52..66477400 100644 --- a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs +++ b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs @@ -11,6 +11,7 @@ using Azure.AI.OpenAI; using Azure.Core.Pipeline; using Azure.Identity; +using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.AI.AzureOpenAI.Internals; using Microsoft.KernelMemory.AI.OpenAI; @@ -77,7 +78,7 @@ public AzureOpenAITextGenerator( switch (config.Auth) { case AzureOpenAIConfig.AuthTypes.AzureIdentity: - this._client = new OpenAIClient(new Uri(config.Endpoint), new DefaultAzureCredential(), options); + this._client = new OpenAIClient(new Uri(config.Endpoint), azure_credential_utils.GetAzureCredential(), options); break; case AzureOpenAIConfig.AuthTypes.ManualTokenCredential: diff --git a/App/kernel-memory/extensions/AzureQueues/AzureQueues.csproj b/App/kernel-memory/extensions/AzureQueues/AzureQueues.csproj index 35e1a148..ed448406 100644 --- a/App/kernel-memory/extensions/AzureQueues/AzureQueues.csproj +++ b/App/kernel-memory/extensions/AzureQueues/AzureQueues.csproj @@ -9,6 +9,7 @@ + diff --git a/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs b/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs index fdf56701..6d5bece2 100644 --- a/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs +++ b/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs @@ -11,6 +11,7 @@ using Azure.Storage; using Azure.Storage.Queues; using Azure.Storage.Queues.Models; +using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.Diagnostics; using Microsoft.KernelMemory.DocumentStorage; @@ -94,7 +95,7 @@ public AzureQueuesPipeline( { this.ValidateAccountName(config.Account); var suffix = this.ValidateEndpointSuffix(config.EndpointSuffix); - this._clientBuilder = queueName => new QueueClient(new($"https://{config.Account}.queue.{suffix}/{queueName}"), new DefaultAzureCredential()); + this._clientBuilder = queueName => new QueueClient(new($"https://{config.Account}.queue.{suffix}/{queueName}"), azure_credential_utils.GetAzureCredential()); break; } diff --git a/App/kernel-memory/service/Service/Program.cs b/App/kernel-memory/service/Service/Program.cs index 8e2b2b5c..27a400f3 100644 --- a/App/kernel-memory/service/Service/Program.cs +++ b/App/kernel-memory/service/Service/Program.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using Azure.Identity; +using Helpers; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; @@ -20,6 +21,7 @@ using Microsoft.KernelMemory.Pipeline; using Microsoft.KernelMemory.Service.AspNetCore; + // KM Configuration: // // * Settings are loaded at runtime from multiple sources, merging values. @@ -85,7 +87,7 @@ public static void Main(string[] args) // Add Configuration from App Configuration Service appBuilder.Configuration.AddAzureAppConfiguration(options => { - options.Connect(new Uri(appBuilder.Configuration["ConnectionStrings:AppConfig"]), new DefaultAzureCredential()); + options.Connect(new Uri(appBuilder.Configuration["ConnectionStrings:AppConfig"]), azure_credential_utils.GetAzureCredential()); }); From 737e4cf100c59c59b5dd6a4648dbe2c90035a538 Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Thu, 31 Jul 2025 00:40:51 +0530 Subject: [PATCH 2/8] updated app_env --- .../AppConfiguration/AppConfiguration.cs | 5 +++-- .../AppConfiguration/Services.cs | 1 + .../Helpers/azure_credential_utils.cs | 11 ++++++----- .../Microsoft.GS.DPS.Host/appsettings.json | 19 ++++++++++--------- .../Helpers/azure_credential_utils.cs | 9 +++++---- .../infra/modules/container-app.bicep | 4 ++++ .../service/Service/appsettings.json | 3 ++- .../appconfig/aiservice/appconfig.jsonl | 4 +++- 8 files changed, 34 insertions(+), 22 deletions(-) diff --git a/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs b/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs index 15c03131..41ab143a 100644 --- a/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs +++ b/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/AppConfiguration.cs @@ -12,12 +12,13 @@ public static void Config(IHostApplicationBuilder builder) //Read ServiceConfiguration files - appsettings.json / appsettings.Development.json //builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); //builder.Configuration.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: true); - + var servicesConfig = builder.Configuration.GetSection("Application:Services").Get(); + string appEnv = servicesConfig?.APP_ENV; //Read AppConfiguration with managed Identity builder.Configuration.AddAzureAppConfiguration(options => { - options.Connect(new Uri(builder.Configuration["ConnectionStrings:AppConfig"]), AzureCredentialHelper.GetAzureCredential()); + options.Connect(new Uri(builder.Configuration["ConnectionStrings:AppConfig"]), AzureCredentialHelper.GetAzureCredential(appEnv)); }); //Read ServiceConfiguration diff --git a/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/Services.cs b/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/Services.cs index c55cc9f8..f68aaa30 100644 --- a/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/Services.cs +++ b/App/backend-api/Microsoft.GS.DPS.Host/AppConfiguration/Services.cs @@ -6,6 +6,7 @@ public class Services public KernelMemoryConfig KernelMemory { get; set; } public PersistentStorageConfig PersistentStorage { get; set; } public AzureAISearchConfig AzureAISearch { get; set; } + public string APP_ENV { get; set; } public class AzureAISearchConfig { diff --git a/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs b/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs index 2bda3ee9..6439cca3 100644 --- a/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs +++ b/App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs @@ -7,11 +7,12 @@ namespace Microsoft.GS.DPSHost.Helpers { public static class AzureCredentialHelper { - public static TokenCredential GetAzureCredential(string clientId = null) + public static TokenCredential GetAzureCredential(string appEnv = "prod", string clientId = null) { - var env = Environment.GetEnvironmentVariable("APP_ENV") ?? "prod"; + //var env = Environment.GetEnvironmentVariable("APP_ENV") ?? "prod"; + Console.WriteLine($"Current APP_ENV: {appEnv}"); - if (string.Equals(env, "dev", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(appEnv, "dev", StringComparison.OrdinalIgnoreCase)) { return new DefaultAzureCredential(); // For local development } @@ -23,9 +24,9 @@ public static TokenCredential GetAzureCredential(string clientId = null) } } - public static Task GetAzureCredentialAsync(string clientId = null) + public static Task GetAzureCredentialAsync(string appEnv = "prod", string clientId = null) { - return Task.FromResult(GetAzureCredential(clientId)); + return Task.FromResult(GetAzureCredential(appEnv, clientId)); } } } diff --git a/App/backend-api/Microsoft.GS.DPS.Host/appsettings.json b/App/backend-api/Microsoft.GS.DPS.Host/appsettings.json index a6fbb98b..e00d9704 100644 --- a/App/backend-api/Microsoft.GS.DPS.Host/appsettings.json +++ b/App/backend-api/Microsoft.GS.DPS.Host/appsettings.json @@ -28,15 +28,16 @@ } }, "Services": { - "CognitiveService": { - "DocumentIntelligence": { - "Endpoint": "", - "APIKey": "" - } - }, - "KernelMemory": { - "Endpoint": "" - } + "CognitiveService": { + "DocumentIntelligence": { + "Endpoint": "", + "APIKey": "" + } + }, + "KernelMemory": { + "Endpoint": "" + }, + "APP_ENV": "prod" } } } diff --git a/App/kernel-memory/Helpers/azure_credential_utils.cs b/App/kernel-memory/Helpers/azure_credential_utils.cs index 6fa6ab30..82ae5504 100644 --- a/App/kernel-memory/Helpers/azure_credential_utils.cs +++ b/App/kernel-memory/Helpers/azure_credential_utils.cs @@ -1,16 +1,17 @@ -using System; +// Copyright (c) Microsoft. All rights reserved. +using System; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; namespace Helpers; -public static class azure_credential_utils +public class azure_credential_utils { public static TokenCredential GetAzureCredential(string clientId = null) { - var env = Environment.GetEnvironmentVariable("APP_ENV") ?? "prod"; + var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; - if (string.Equals(env, "dev", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(env, "Development", StringComparison.OrdinalIgnoreCase)) { return new DefaultAzureCredential(); // For local development } diff --git a/App/kernel-memory/infra/modules/container-app.bicep b/App/kernel-memory/infra/modules/container-app.bicep index 015c2105..ff478b0a 100644 --- a/App/kernel-memory/infra/modules/container-app.bicep +++ b/App/kernel-memory/infra/modules/container-app.bicep @@ -172,6 +172,10 @@ resource kmService 'Microsoft.App/containerApps@2023-05-01' = { name: 'KernelMemory__Services__AzureAIDocIntel__Endpoint' value: AzureAIDocIntel_Endpoint } + { + name: 'APP_ENV' + value: 'prod' + } ] } ] diff --git a/App/kernel-memory/service/Service/appsettings.json b/App/kernel-memory/service/Service/appsettings.json index 4dc741c1..b5a8ff95 100644 --- a/App/kernel-memory/service/Service/appsettings.json +++ b/App/kernel-memory/service/Service/appsettings.json @@ -465,7 +465,8 @@ "MemoryTableName": "KMMemories", "EmbeddingsTableName": "KMEmbeddings", "TagsTableName": "KMMemoriesTags" - } + }, + "APP_ENV": "prod" } } } diff --git a/Deployment/appconfig/aiservice/appconfig.jsonl b/Deployment/appconfig/aiservice/appconfig.jsonl index 6066134f..5c7c54ac 100644 --- a/Deployment/appconfig/aiservice/appconfig.jsonl +++ b/Deployment/appconfig/aiservice/appconfig.jsonl @@ -18,6 +18,7 @@ "Application:Services:PersistentStorage:CosmosMongo:ConnectionString": "{cosmosmongo-connection-string}", "Application:Services:AzureAISearch:APIKey" : "{azureaisearch-apikey}", "Application:Services:AzureAISearch:Endpoint" : "{azureaisearch-endpoint}", + "Application:Services:APP_ENV": "prod", "KernelMemory:Services:AzureAIDocIntel:APIKey": "{azureaidocintel-apikey}", "KernelMemory:Services:AzureAIDocIntel:Endpoint": "{azureaidocintel-endpoint}", "KernelMemory:Services:AzureAISearch:APIKey": "{azureaisearch-apikey}", @@ -32,5 +33,6 @@ "KernelMemory:Services:AzureOpenAIText:Deployment": "{azureopenaitext-deployment}", "KernelMemory:Services:AzureOpenAIText:Endpoint": "{azureopenaitext-endpoint}", "KernelMemory:Services:AzureQueues:Account": "{azurequeues-account}", - "KernelMemory:Services:AzureQueues:ConnectionString": "{azurequeues-connection-string}" + "KernelMemory:Services:AzureQueues:ConnectionString": "{azurequeues-connection-string}", + "KernelMemory:Services:APP_ENV": "prod" } \ No newline at end of file From a67140764f5c81713cc26e168ab197f3b4d3cecb Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Thu, 31 Jul 2025 00:58:54 +0530 Subject: [PATCH 3/8] access the variable in kernel memory --- App/kernel-memory/Helpers/AppGlobals.cs | 14 ++++++++++++++ .../Helpers/azure_credential_utils.cs | 5 +++-- App/kernel-memory/service/Service/Program.cs | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 App/kernel-memory/Helpers/AppGlobals.cs diff --git a/App/kernel-memory/Helpers/AppGlobals.cs b/App/kernel-memory/Helpers/AppGlobals.cs new file mode 100644 index 00000000..751af8a5 --- /dev/null +++ b/App/kernel-memory/Helpers/AppGlobals.cs @@ -0,0 +1,14 @@ +using Microsoft.Extensions.Configuration; + +namespace Helpers +{ + public static class AppGlobals + { + public static IConfiguration Configuration { get; private set; } + + public static void Init(IConfiguration configuration) + { + Configuration = configuration; + } + } +} diff --git a/App/kernel-memory/Helpers/azure_credential_utils.cs b/App/kernel-memory/Helpers/azure_credential_utils.cs index 82ae5504..0fa18b6c 100644 --- a/App/kernel-memory/Helpers/azure_credential_utils.cs +++ b/App/kernel-memory/Helpers/azure_credential_utils.cs @@ -9,9 +9,10 @@ public class azure_credential_utils { public static TokenCredential GetAzureCredential(string clientId = null) { - var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; + //var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; + var appEnv = AppGlobals.Configuration["KernelMemory:Services:APP_ENV"] ?? "prod"; - if (string.Equals(env, "Development", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(appEnv, "dev", StringComparison.OrdinalIgnoreCase)) { return new DefaultAzureCredential(); // For local development } diff --git a/App/kernel-memory/service/Service/Program.cs b/App/kernel-memory/service/Service/Program.cs index 27a400f3..3d848232 100644 --- a/App/kernel-memory/service/Service/Program.cs +++ b/App/kernel-memory/service/Service/Program.cs @@ -95,6 +95,7 @@ public static void Main(string[] args) KernelMemoryConfig config = appBuilder.Configuration.GetSection("KernelMemory").Get() ?? throw new ConfigurationException("Unable to load configuration"); + AppGlobals.Init(appBuilder.Configuration); // Some OpenAPI Explorer/Swagger dependencies appBuilder.ConfigureSwagger(config); From a65624860b9d5ec7bba95c3d5b859ea6f2789f4a Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Thu, 31 Jul 2025 01:24:54 +0530 Subject: [PATCH 4/8] migrate model type to global standard --- Deployment/appconfig/aiservice/appconfig.jsonl | 4 ++-- Deployment/resourcedeployment.ps1 | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Deployment/appconfig/aiservice/appconfig.jsonl b/Deployment/appconfig/aiservice/appconfig.jsonl index 5c7c54ac..ce11e2c5 100644 --- a/Deployment/appconfig/aiservice/appconfig.jsonl +++ b/Deployment/appconfig/aiservice/appconfig.jsonl @@ -18,7 +18,7 @@ "Application:Services:PersistentStorage:CosmosMongo:ConnectionString": "{cosmosmongo-connection-string}", "Application:Services:AzureAISearch:APIKey" : "{azureaisearch-apikey}", "Application:Services:AzureAISearch:Endpoint" : "{azureaisearch-endpoint}", - "Application:Services:APP_ENV": "prod", + "Application:Services:APP_ENV": "{app-environment}", "KernelMemory:Services:AzureAIDocIntel:APIKey": "{azureaidocintel-apikey}", "KernelMemory:Services:AzureAIDocIntel:Endpoint": "{azureaidocintel-endpoint}", "KernelMemory:Services:AzureAISearch:APIKey": "{azureaisearch-apikey}", @@ -34,5 +34,5 @@ "KernelMemory:Services:AzureOpenAIText:Endpoint": "{azureopenaitext-endpoint}", "KernelMemory:Services:AzureQueues:Account": "{azurequeues-account}", "KernelMemory:Services:AzureQueues:ConnectionString": "{azurequeues-connection-string}", - "KernelMemory:Services:APP_ENV": "prod" + "KernelMemory:Services:APP_ENV": "{app-environment}" } \ No newline at end of file diff --git a/Deployment/resourcedeployment.ps1 b/Deployment/resourcedeployment.ps1 index 02f30dfe..06189ff6 100644 --- a/Deployment/resourcedeployment.ps1 +++ b/Deployment/resourcedeployment.ps1 @@ -600,6 +600,7 @@ try { '{azureaidocintel-apikey}' = $deploymentResult.AzCognitiveServiceKey '{cosmosmongo-chat-history-collection}' = "ChatHistory" '{cosmosmongo-chat-history-database}' = "DPS" + '{app-environment}' = "prod" '{cosmosmongo-document-manager-collection}' = "Documents" '{cosmosmongo-document-manager-database}' = "DPS" '{azureaidocintel-endpoint}' = $deploymentResult.AzCognitiveServiceEndpoint From a321ae5133b05b5fc4b4a7214f71a57e5eba5a84 Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Thu, 31 Jul 2025 04:00:23 +0530 Subject: [PATCH 5/8] changes app_Env --- App/kernel-memory/Helpers/AppGlobals.cs | 14 -------------- .../AzureAIDocIntel/AzureAIDocIntelConfig.cs | 2 ++ .../AzureAIDocIntel/AzureAIDocIntelEngine.cs | 3 ++- .../AzureAISearch/AzureAISearchConfig.cs | 2 ++ .../AzureAISearch/AzureAISearchMemory.cs | 2 +- .../extensions/AzureBlobs/AzureBlobsConfig.cs | 2 ++ .../extensions/AzureBlobs/AzureBlobsStorage.cs | 2 +- .../extensions/AzureOpenAI/AzureOpenAIConfig.cs | 2 ++ .../AzureOpenAITextEmbeddingGenerator.cs | 2 +- .../AzureOpenAI/AzureOpenAITextGenerator.cs | 2 +- .../extensions/AzureQueues/AzureQueuesConfig.cs | 2 ++ .../extensions/AzureQueues/AzureQueuesPipeline.cs | 2 +- .../Core/Configuration/KernelMemoryConfig.cs | 2 ++ 13 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 App/kernel-memory/Helpers/AppGlobals.cs diff --git a/App/kernel-memory/Helpers/AppGlobals.cs b/App/kernel-memory/Helpers/AppGlobals.cs deleted file mode 100644 index 751af8a5..00000000 --- a/App/kernel-memory/Helpers/AppGlobals.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Extensions.Configuration; - -namespace Helpers -{ - public static class AppGlobals - { - public static IConfiguration Configuration { get; private set; } - - public static void Init(IConfiguration configuration) - { - Configuration = configuration; - } - } -} diff --git a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelConfig.cs b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelConfig.cs index f6a05883..99ba7502 100644 --- a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelConfig.cs +++ b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelConfig.cs @@ -23,6 +23,8 @@ public enum AuthTypes public string APIKey { get; set; } = string.Empty; + public string APP_ENV { get; set; } = "prod"; + /// /// Verify that the current state is valid. /// diff --git a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs index cf8d1fdf..6d824c95 100644 --- a/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs +++ b/App/kernel-memory/extensions/AzureAIDocIntel/AzureAIDocIntelEngine.cs @@ -11,6 +11,7 @@ using Helpers; using Microsoft.Extensions.Logging; using Microsoft.KernelMemory.Diagnostics; +using Microsoft.KernelMemory.Configuration; namespace Microsoft.KernelMemory.DataFormats.AzureAIDocIntel; @@ -38,7 +39,7 @@ public AzureAIDocIntelEngine( switch (config.Auth) { case AzureAIDocIntelConfig.AuthTypes.AzureIdentity: - this._recognizerClient = new DocumentAnalysisClient(new Uri(config.Endpoint), azure_credential_utils.GetAzureCredential()); + this._recognizerClient = new DocumentAnalysisClient(new Uri(config.Endpoint), azure_credential_utils.GetAzureCredential(config.APP_ENV)); break; case AzureAIDocIntelConfig.AuthTypes.APIKey: diff --git a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchConfig.cs b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchConfig.cs index d9023ab6..44b03d74 100644 --- a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchConfig.cs +++ b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchConfig.cs @@ -25,6 +25,8 @@ public enum AuthTypes public string Endpoint { get; set; } = string.Empty; public string APIKey { get; set; } = string.Empty; + public string APP_ENV { get; set; } = "prod"; + /// /// Important: when using hybrid search, relevance scores /// are very different (e.g. lower) from when using just vector search. diff --git a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs index 7190a15c..b99a2baa 100644 --- a/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs +++ b/App/kernel-memory/extensions/AzureAISearch/AzureAISearch/AzureAISearchMemory.cs @@ -67,7 +67,7 @@ public AzureAISearchMemory( case AzureAISearchConfig.AuthTypes.AzureIdentity: this._adminClient = new SearchIndexClient( new Uri(config.Endpoint), - azure_credential_utils.GetAzureCredential(), + azure_credential_utils.GetAzureCredential(config.APP_ENV), GetClientOptions()); break; diff --git a/App/kernel-memory/extensions/AzureBlobs/AzureBlobsConfig.cs b/App/kernel-memory/extensions/AzureBlobs/AzureBlobsConfig.cs index 109e0019..ed61616e 100644 --- a/App/kernel-memory/extensions/AzureBlobs/AzureBlobsConfig.cs +++ b/App/kernel-memory/extensions/AzureBlobs/AzureBlobsConfig.cs @@ -35,6 +35,8 @@ public enum AuthTypes public string EndpointSuffix { get; set; } = "core.windows.net"; public string Container { get; set; } = ""; + public string APP_ENV { get; set; } = "prod"; + public void SetCredential(StorageSharedKeyCredential credential) { this.Auth = AuthTypes.ManualStorageSharedKeyCredential; diff --git a/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs b/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs index 03b4b8b8..109e7999 100644 --- a/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs +++ b/App/kernel-memory/extensions/AzureBlobs/AzureBlobsStorage.cs @@ -62,7 +62,7 @@ public AzureBlobsStorage( { this.ValidateAccountName(config.Account); var suffix = this.ValidateEndpointSuffix(config.EndpointSuffix); - client = new BlobServiceClient(new Uri($"https://{config.Account}.blob.{suffix}"), azure_credential_utils.GetAzureCredential()); + client = new BlobServiceClient(new Uri($"https://{config.Account}.blob.{suffix}"), azure_credential_utils.GetAzureCredential(config.APP_ENV)); break; } diff --git a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAIConfig.cs b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAIConfig.cs index 993b6598..caf7f493 100644 --- a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAIConfig.cs +++ b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAIConfig.cs @@ -52,6 +52,8 @@ public enum APITypes /// public string Endpoint { get; set; } = string.Empty; + public string APP_ENV { get; set; } = "prod"; + /// /// Azure OpenAI deployment name /// diff --git a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs index 75c42b91..784be4b7 100644 --- a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs +++ b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextEmbeddingGenerator.cs @@ -53,7 +53,7 @@ public AzureOpenAITextEmbeddingGenerator( this._client = new AzureOpenAITextEmbeddingGenerationService( deploymentName: config.Deployment, endpoint: config.Endpoint, - credential: azure_credential_utils.GetAzureCredential(), + credential: azure_credential_utils.GetAzureCredential(config.APP_ENV), modelId: config.Deployment, httpClient: httpClient, dimensions: config.EmbeddingDimensions, diff --git a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs index 66477400..8eac9a73 100644 --- a/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs +++ b/App/kernel-memory/extensions/AzureOpenAI/AzureOpenAITextGenerator.cs @@ -78,7 +78,7 @@ public AzureOpenAITextGenerator( switch (config.Auth) { case AzureOpenAIConfig.AuthTypes.AzureIdentity: - this._client = new OpenAIClient(new Uri(config.Endpoint), azure_credential_utils.GetAzureCredential(), options); + this._client = new OpenAIClient(new Uri(config.Endpoint), azure_credential_utils.GetAzureCredential(config.APP_ENV), options); break; case AzureOpenAIConfig.AuthTypes.ManualTokenCredential: diff --git a/App/kernel-memory/extensions/AzureQueues/AzureQueuesConfig.cs b/App/kernel-memory/extensions/AzureQueues/AzureQueuesConfig.cs index c357a9f8..3b4a8e30 100644 --- a/App/kernel-memory/extensions/AzureQueues/AzureQueuesConfig.cs +++ b/App/kernel-memory/extensions/AzureQueues/AzureQueuesConfig.cs @@ -37,6 +37,8 @@ public enum AuthTypes public string AccountKey { get; set; } = ""; public string EndpointSuffix { get; set; } = "core.windows.net"; + public string APP_ENV { get; set; } = "prod"; + /// /// How often to check if there are new messages. /// diff --git a/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs b/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs index 6d5bece2..ea286f82 100644 --- a/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs +++ b/App/kernel-memory/extensions/AzureQueues/AzureQueuesPipeline.cs @@ -95,7 +95,7 @@ public AzureQueuesPipeline( { this.ValidateAccountName(config.Account); var suffix = this.ValidateEndpointSuffix(config.EndpointSuffix); - this._clientBuilder = queueName => new QueueClient(new($"https://{config.Account}.queue.{suffix}/{queueName}"), azure_credential_utils.GetAzureCredential()); + this._clientBuilder = queueName => new QueueClient(new($"https://{config.Account}.queue.{suffix}/{queueName}"), azure_credential_utils.GetAzureCredential(config.APP_ENV)); break; } diff --git a/App/kernel-memory/service/Core/Configuration/KernelMemoryConfig.cs b/App/kernel-memory/service/Core/Configuration/KernelMemoryConfig.cs index f1b5b62e..20709c0d 100644 --- a/App/kernel-memory/service/Core/Configuration/KernelMemoryConfig.cs +++ b/App/kernel-memory/service/Core/Configuration/KernelMemoryConfig.cs @@ -162,6 +162,8 @@ public string ContentStorageType /// public string DefaultIndexName { get; set; } = "default"; + public string APP_ENV { get; set; } = "prod"; + /// /// HTTP service authorization settings. /// From c77bb891f6f7f9c8fbebf28f2dc615b082e77757 Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Thu, 31 Jul 2025 04:01:01 +0530 Subject: [PATCH 6/8] changes app_Env --- .../Helpers/azure_credential.utils.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 App/kernel-memory/Helpers/azure_credential.utils.cs diff --git a/App/kernel-memory/Helpers/azure_credential.utils.cs b/App/kernel-memory/Helpers/azure_credential.utils.cs new file mode 100644 index 00000000..51395387 --- /dev/null +++ b/App/kernel-memory/Helpers/azure_credential.utils.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +using System; +using System.Reflection.PortableExecutable; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +namespace Helpers; + +public class azure_credential_utils +{ + public static TokenCredential GetAzureCredential(string appEnv = "prod", string clientId = null) + { + //var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; + + if (string.Equals(appEnv, "dev", StringComparison.OrdinalIgnoreCase)) + { + return new DefaultAzureCredential(); // For local development + } + else + { + return clientId != null + ? new ManagedIdentityCredential(clientId) + : new ManagedIdentityCredential(); + } + } + + public static Task GetAzureCredentialAsync(string appEnv = "prod", string clientId = null) + { + return Task.FromResult(GetAzureCredential(appEnv, clientId)); + } +} From fcb10a873062754c94c208496ef81abf0941022b Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Wed, 30 Jul 2025 23:09:11 +0000 Subject: [PATCH 7/8] deleted extra dile --- .../Helpers/azure_credential.utils.cs | 31 ------------------- .../Helpers/azure_credential_utils.cs | 10 +++--- 2 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 App/kernel-memory/Helpers/azure_credential.utils.cs diff --git a/App/kernel-memory/Helpers/azure_credential.utils.cs b/App/kernel-memory/Helpers/azure_credential.utils.cs deleted file mode 100644 index 51395387..00000000 --- a/App/kernel-memory/Helpers/azure_credential.utils.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -using System; -using System.Reflection.PortableExecutable; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -namespace Helpers; - -public class azure_credential_utils -{ - public static TokenCredential GetAzureCredential(string appEnv = "prod", string clientId = null) - { - //var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; - - if (string.Equals(appEnv, "dev", StringComparison.OrdinalIgnoreCase)) - { - return new DefaultAzureCredential(); // For local development - } - else - { - return clientId != null - ? new ManagedIdentityCredential(clientId) - : new ManagedIdentityCredential(); - } - } - - public static Task GetAzureCredentialAsync(string appEnv = "prod", string clientId = null) - { - return Task.FromResult(GetAzureCredential(appEnv, clientId)); - } -} diff --git a/App/kernel-memory/Helpers/azure_credential_utils.cs b/App/kernel-memory/Helpers/azure_credential_utils.cs index 0fa18b6c..de1f00d9 100644 --- a/App/kernel-memory/Helpers/azure_credential_utils.cs +++ b/App/kernel-memory/Helpers/azure_credential_utils.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System; +using System.Reflection.PortableExecutable; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; @@ -7,10 +8,9 @@ namespace Helpers; public class azure_credential_utils { - public static TokenCredential GetAzureCredential(string clientId = null) + public static TokenCredential GetAzureCredential(string appEnv = "prod", string clientId = null) { //var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; - var appEnv = AppGlobals.Configuration["KernelMemory:Services:APP_ENV"] ?? "prod"; if (string.Equals(appEnv, "dev", StringComparison.OrdinalIgnoreCase)) { @@ -24,8 +24,8 @@ public static TokenCredential GetAzureCredential(string clientId = null) } } - public static Task GetAzureCredentialAsync(string clientId = null) + public static Task GetAzureCredentialAsync(string appEnv = "prod", string clientId = null) { - return Task.FromResult(GetAzureCredential(clientId)); + return Task.FromResult(GetAzureCredential(appEnv, clientId)); } -} +} \ No newline at end of file From f675628c405f268070ad637b350c6b125895cf2b Mon Sep 17 00:00:00 2001 From: Priyanka-Microsoft Date: Thu, 31 Jul 2025 10:24:17 +0530 Subject: [PATCH 8/8] changes app_Env --- App/kernel-memory/service/Service/Program.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/App/kernel-memory/service/Service/Program.cs b/App/kernel-memory/service/Service/Program.cs index 3d848232..993e49d3 100644 --- a/App/kernel-memory/service/Service/Program.cs +++ b/App/kernel-memory/service/Service/Program.cs @@ -84,10 +84,13 @@ public static void Main(string[] args) appBuilder.Configuration.AddKMConfigurationSources(); + var servicesConfig = appBuilder.Configuration.GetSection("KernelMemory").Get(); + string appEnv = servicesConfig?.APP_ENV; + // Add Configuration from App Configuration Service appBuilder.Configuration.AddAzureAppConfiguration(options => { - options.Connect(new Uri(appBuilder.Configuration["ConnectionStrings:AppConfig"]), azure_credential_utils.GetAzureCredential()); + options.Connect(new Uri(appBuilder.Configuration["ConnectionStrings:AppConfig"]), azure_credential_utils.GetAzureCredential(appEnv: appEnv)); }); @@ -95,7 +98,6 @@ public static void Main(string[] args) KernelMemoryConfig config = appBuilder.Configuration.GetSection("KernelMemory").Get() ?? throw new ConfigurationException("Unable to load configuration"); - AppGlobals.Init(appBuilder.Configuration); // Some OpenAPI Explorer/Swagger dependencies appBuilder.ConfigureSwagger(config);