diff --git a/src/Web/Program.cs b/src/Web/Program.cs index d67117a..af23e7f 100644 --- a/src/Web/Program.cs +++ b/src/Web/Program.cs @@ -34,15 +34,15 @@ if (detectEnvApp.Environment.IsDevelopment() || detectEnvApp.Environment.Environ else{ // Configure SQL Server (prod) var credential = new ChainedTokenCredential(new AzureDeveloperCliCredential(), new DefaultAzureCredential()); - builder.Configuration.AddAzureKeyVault(new Uri(builder.Configuration["AZURE_KEY_VAULT_ENDPOINT"]), credential); + builder.Configuration.AddAzureKeyVault(new Uri(builder.Configuration["AZURE_KEY_VAULT_ENDPOINT"] ?? ""), credential); builder.Services.AddDbContext(c => { - var connectionString = builder.Configuration[builder.Configuration["AZURE_SQL_CATALOG_CONNECTION_STRING_KEY"]]; + var connectionString = builder.Configuration[builder.Configuration["AZURE_SQL_CATALOG_CONNECTION_STRING_KEY"] ?? ""]; c.UseSqlServer(connectionString, sqlOptions => sqlOptions.EnableRetryOnFailure()); }); builder.Services.AddDbContext(options => { - var connectionString = builder.Configuration[builder.Configuration["AZURE_SQL_IDENTITY_CONNECTION_STRING_KEY"]]; + var connectionString = builder.Configuration[builder.Configuration["AZURE_SQL_IDENTITY_CONNECTION_STRING_KEY"] ?? ""]; options.UseSqlServer(connectionString, sqlOptions => sqlOptions.EnableRetryOnFailure()); }); }