Skip to content

Commit

Permalink
Move production parameter setting before first use
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhulen committed Feb 28, 2024
1 parent 5bb59c0 commit e2d40d5
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/dotnet/AgentFactoryAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -61,8 +63,6 @@ public static void Main(string[] args)
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

// Add services to the container.
// Add the OpenTelemetry telemetry service and send telemetry data to Azure Monitor.
builder.Services.AddOpenTelemetry().UseAzureMonitor(options =>
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/CoreAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -59,8 +61,6 @@ public static void Main(string[] args)
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

var allowAllCorsOrigins = "AllowAllOrigins";
builder.Services.AddCors(policyBuilder =>
{
Expand Down
2 changes: 2 additions & 0 deletions src/dotnet/CoreWorker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

var builder = Host.CreateApplicationBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/GatekeeperAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -55,8 +57,6 @@ public static void Main(string[] args)
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

// Add services to the container.
// Add the OpenTelemetry telemetry service and send telemetry data to Azure Monitor.
builder.Services.AddOpenTelemetry().UseAzureMonitor(options =>
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/ManagementAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public static async Task Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -67,8 +69,6 @@ public static async Task Main(string[] args)
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

// Add the Configuration resource provider
builder.AddConfigurationResourceProvider();

Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/SemanticKernelAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -53,8 +55,6 @@ public static void Main(string[] args)
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

// Add services to the container.
//builder.Services.AddApplicationInsightsTelemetry();
builder.Services.AddAuthorization();
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/VectorizationAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -44,8 +46,6 @@
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

// Add the Configuration resource provider
builder.AddConfigurationResourceProvider();

Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/VectorizationWorker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

var builder = WebApplication.CreateBuilder(args);

DefaultAuthentication.Production = builder.Environment.IsProduction();

builder.Configuration.Sources.Clear();
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddEnvironmentVariables();
Expand All @@ -46,8 +48,6 @@
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);

DefaultAuthentication.Production = builder.Environment.IsProduction();

// Add the Configuration resource provider
builder.AddConfigurationResourceProvider();

Expand Down

0 comments on commit e2d40d5

Please sign in to comment.