Avoid azure app config for local environment

This commit is contained in:
2025-06-09 00:45:40 -06:00
parent f82ebb5e69
commit 8d954c9a09

View File

@@ -16,6 +16,10 @@ namespace Core.Thalos.Adapters.Helpers
public static AuthSettings GetAuthSettings(WebApplicationBuilder builder, string appConfigLabel) public static AuthSettings GetAuthSettings(WebApplicationBuilder builder, string appConfigLabel)
{
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? string.Empty;
if (environment != "Local")
{ {
builder.Configuration.AddAzureAppConfiguration(options => builder.Configuration.AddAzureAppConfiguration(options =>
{ {
@@ -33,6 +37,7 @@ namespace Core.Thalos.Adapters.Helpers
keyVaultOptions.SetCredential(new DefaultAzureCredential()); keyVaultOptions.SetCredential(new DefaultAzureCredential());
}); });
}); });
}
return new AuthSettings return new AuthSettings
{ {