diff --git a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj index cf963debc..eb88972c0 100644 --- a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj +++ b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj @@ -5,11 +5,7 @@ - - - - - + diff --git a/src/ApiGateways/ApiGw-Base/Program.cs b/src/ApiGateways/ApiGw-Base/Program.cs index c8f8d7993..bcf1c8d60 100644 --- a/src/ApiGateways/ApiGw-Base/Program.cs +++ b/src/ApiGateways/ApiGw-Base/Program.cs @@ -25,6 +25,12 @@ namespace OcelotApiGw builder.ConfigureServices(s => s.AddSingleton(builder)) .ConfigureAppConfiguration(ic => ic.AddJsonFile(Path.Combine("configuration", "configuration.json"))) .UseStartup() + .ConfigureLogging((hostingContext, loggingbuilder) => + { + loggingbuilder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); + loggingbuilder.AddConsole(); + loggingbuilder.AddDebug(); + }) .UseSerilog((builderContext, config) => { config diff --git a/src/ApiGateways/ApiGw-Base/Startup.cs b/src/ApiGateways/ApiGw-Base/Startup.cs index cd90bd7ca..585c26471 100644 --- a/src/ApiGateways/ApiGw-Base/Startup.cs +++ b/src/ApiGateways/ApiGw-Base/Startup.cs @@ -76,7 +76,7 @@ namespace OcelotApiGw services.AddOcelot(_cfg); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, IHostingEnvironment env) { var pathBase = _cfg["PATH_BASE"]; @@ -101,8 +101,6 @@ namespace OcelotApiGw Predicate = r => r.Name.Contains("self") }); - loggerFactory.AddConsole(_cfg.GetSection("Logging")); - app.UseCors("CorsPolicy"); app.UseOcelot().Wait(); diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj index 6300d6711..1e9508843 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj @@ -13,14 +13,14 @@ - + - + diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj index de2f55ab8..a15e101d3 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj @@ -13,13 +13,13 @@ - + - + diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj index 6e0215c29..62373d1b3 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj index 288c4256a..3de07e329 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj index 731953225..ef3463cca 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj @@ -6,10 +6,10 @@ - - - - + + + + diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index 4add803b6..d6459698c 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -13,21 +13,21 @@ - + - - + + - + diff --git a/src/Services/Basket/Basket.API/Infrastructure/Filters/AuthorizeCheckOperationFilter.cs b/src/Services/Basket/Basket.API/Infrastructure/Filters/AuthorizeCheckOperationFilter.cs index 7caa9740d..f1c7b08d0 100644 --- a/src/Services/Basket/Basket.API/Infrastructure/Filters/AuthorizeCheckOperationFilter.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Filters/AuthorizeCheckOperationFilter.cs @@ -19,11 +19,13 @@ namespace Basket.API.Infrastructure.Filters operation.Responses.Add("401", new Response { Description = "Unauthorized" }); operation.Responses.Add("403", new Response { Description = "Forbidden" }); - operation.Security = new List>>(); - operation.Security.Add(new Dictionary> + operation.Security = new List>> { - { "oauth2", new [] { "basketapi" } } - }); + new Dictionary> + { + { "oauth2", new [] { "basketapi" } } + } + }; } } } diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index e4328645e..cf53c1b13 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -48,6 +48,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseSerilog((builderContext, config) => { diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index eecc8bdd4..4b9d65cc7 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -179,9 +179,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -228,7 +227,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj index 2a2635354..e781b218d 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj +++ b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj @@ -17,12 +17,15 @@ - + - - + + + all + runtime; build; native; contentfiles; analyzers + - + diff --git a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj index 071bbf52b..bf5cb593a 100644 --- a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj +++ b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj @@ -7,12 +7,15 @@ - - - + + + + all + runtime; build; native; contentfiles; analyzers + - + diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index a2be6b522..e7c996586 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -34,7 +34,7 @@ - + @@ -42,14 +42,14 @@ - - + + - - + + diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 3f4c19955..c4ebb6183 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -60,6 +60,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseSerilog((builderContext, config) => { diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 5c77d37c8..9c91a743e 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -60,11 +60,10 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API } - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { //Configure logs - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -117,7 +116,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj index b38d20ff1..07e9e2991 100644 --- a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj +++ b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj @@ -33,10 +33,13 @@ - + - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj index 9e6a4a4ba..6a9a2bf99 100644 --- a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj +++ b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj @@ -7,11 +7,14 @@ - - - + + + + all + runtime; build; native; contentfiles; analyzers + - + diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 077d6c624..fe4432af8 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -15,13 +15,13 @@ - + - - + + @@ -31,7 +31,7 @@ - + diff --git a/src/Services/Identity/Identity.API/Program.cs b/src/Services/Identity/Identity.API/Program.cs index d06d49492..401a2b8a5 100644 --- a/src/Services/Identity/Identity.API/Program.cs +++ b/src/Services/Identity/Identity.API/Program.cs @@ -67,6 +67,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index aa390779e..b6e0d1390 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -117,10 +117,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); - loggerFactory.AddAzureWebAppDiagnostics(); + { loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); if (env.IsDevelopment()) @@ -182,7 +179,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Location/Locations.API/Locations.API.csproj b/src/Services/Location/Locations.API/Locations.API.csproj index 38d72a235..247865c85 100644 --- a/src/Services/Location/Locations.API/Locations.API.csproj +++ b/src/Services/Location/Locations.API/Locations.API.csproj @@ -6,15 +6,15 @@ aspnet-Locations.API-20161122013619 - + - - + + diff --git a/src/Services/Location/Locations.API/Program.cs b/src/Services/Location/Locations.API/Program.cs index 83c586088..11be8d68c 100644 --- a/src/Services/Location/Locations.API/Program.cs +++ b/src/Services/Location/Locations.API/Program.cs @@ -43,6 +43,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 3e1936a55..f92000b84 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -153,9 +153,8 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -201,7 +200,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj index ce098d42c..0b7e0a3c4 100644 --- a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj +++ b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj @@ -17,10 +17,13 @@ - + - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Services/Marketing/Marketing.API/Marketing.API.csproj b/src/Services/Marketing/Marketing.API/Marketing.API.csproj index f3e15515b..23116cc28 100644 --- a/src/Services/Marketing/Marketing.API/Marketing.API.csproj +++ b/src/Services/Marketing/Marketing.API/Marketing.API.csproj @@ -21,7 +21,7 @@ - + @@ -29,11 +29,11 @@ - + - + diff --git a/src/Services/Marketing/Marketing.API/Program.cs b/src/Services/Marketing/Marketing.API/Program.cs index a885a3af6..cca7f4d79 100644 --- a/src/Services/Marketing/Marketing.API/Program.cs +++ b/src/Services/Marketing/Marketing.API/Program.cs @@ -55,6 +55,7 @@ builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index 826c8cb81..276a82fa9 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -179,7 +179,6 @@ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env,ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -225,7 +224,7 @@ if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj b/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj index 2ffe9600b..ae4f51ed7 100644 --- a/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj +++ b/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj @@ -17,10 +17,13 @@ - + - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index abd68e9a6..ff8ae6607 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -28,7 +28,7 @@ - + @@ -36,8 +36,8 @@ - - + + @@ -48,7 +48,7 @@ - + diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index b97ced4d4..8db59598c 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -59,6 +59,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index b517dfaa9..03e9b1d7f 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -74,7 +74,6 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -147,7 +146,7 @@ if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj index b757cada9..bd31074e7 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj @@ -14,11 +14,11 @@ - + - + diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs index 5844a3964..683fe1d0c 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs @@ -103,7 +103,7 @@ namespace Ordering.BackgroundTasks // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env) + public void Configure(IApplicationBuilder app) { app.UseHealthChecks("/hc", new HealthCheckOptions() { diff --git a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj index 0baae56b1..f79d76c60 100644 --- a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj +++ b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj index 1568886f0..93f6bfb88 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj +++ b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj @@ -17,10 +17,13 @@ - + - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj b/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj index d57c30031..4f1a74889 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj +++ b/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj index dfc6a45c3..bca77a619 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +++ b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj @@ -11,7 +11,7 @@ - + @@ -22,10 +22,10 @@ - - + + - + diff --git a/src/Services/Ordering/Ordering.SignalrHub/Program.cs b/src/Services/Ordering/Ordering.SignalrHub/Program.cs index e8550dcc8..3fe2e8c24 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Program.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Program.cs @@ -21,6 +21,13 @@ namespace Ordering.SignalrHub public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() + .ConfigureLogging((hostingContext, builder) => + { + builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); + builder.AddConsole(); + builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); + }) .UseSerilog((builderContext, config) => { config diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index 555606a67..20f8b739b 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -120,9 +120,6 @@ namespace Ordering.SignalrHub // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; diff --git a/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj b/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj index 04b155b65..6a3d3c284 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj +++ b/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj @@ -7,12 +7,15 @@ - - - + + + + all + runtime; build; native; contentfiles; analyzers + - + diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 73aa4363e..6a00a1699 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -7,18 +7,18 @@ - + - - + + - + diff --git a/src/Services/Payment/Payment.API/Program.cs b/src/Services/Payment/Payment.API/Program.cs index 0b8c5e025..7a589e8a4 100644 --- a/src/Services/Payment/Payment.API/Program.cs +++ b/src/Services/Payment/Payment.API/Program.cs @@ -28,6 +28,7 @@ namespace Payment.API builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 5241fc1c7..62a3b2321 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -91,7 +91,6 @@ namespace Payment.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -123,7 +122,7 @@ namespace Payment.API if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Webhooks/Webhooks.API/Program.cs b/src/Services/Webhooks/Webhooks.API/Program.cs index 063fe2ac1..b08a1c2da 100644 --- a/src/Services/Webhooks/Webhooks.API/Program.cs +++ b/src/Services/Webhooks/Webhooks.API/Program.cs @@ -22,6 +22,17 @@ namespace Webhooks.API public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) - .UseStartup(); + .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) + .ConfigureLogging((hostingContext, builder) => + { + builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); + builder.AddConsole(); + builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); + }); } } diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index ba3ccfe3d..654b1c897 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -70,9 +70,8 @@ namespace Webhooks.API return new AutofacServiceProvider(container.Build()); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; @@ -142,7 +141,7 @@ namespace Webhooks.API if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index c054e75e7..7dea3fc64 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -13,11 +13,11 @@ - - + + - + diff --git a/src/Web/WebMVC/Program.cs b/src/Web/WebMVC/Program.cs index 7f88feeaf..5000e0422 100644 --- a/src/Web/WebMVC/Program.cs +++ b/src/Web/WebMVC/Program.cs @@ -27,6 +27,7 @@ namespace Microsoft.eShopOnContainers.WebMVC builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index d69b21459..0ec33bc8c 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -52,7 +52,6 @@ namespace Microsoft.eShopOnContainers.WebMVC { JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); app.UseHealthChecks("/hc", new HealthCheckOptions() @@ -122,7 +121,7 @@ namespace Microsoft.eShopOnContainers.WebMVC if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 5e5643c63..a019498ae 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -21,21 +21,21 @@ - + - - + + - - + + - - - + + + diff --git a/src/Web/WebSPA/Program.cs b/src/Web/WebSPA/Program.cs index f4a1ca1b4..bd4382603 100644 --- a/src/Web/WebSPA/Program.cs +++ b/src/Web/WebSPA/Program.cs @@ -27,6 +27,7 @@ namespace eShopConContainers.WebSPA builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 5fe5d03b2..5cfeb98fc 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -75,8 +75,6 @@ namespace eShopConContainers.WebSPA // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAntiforgery antiforgery) { - - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); if (env.IsDevelopment()) @@ -150,7 +148,7 @@ namespace eShopConContainers.WebSPA if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Web/WebSPA/WebSPA.csproj b/src/Web/WebSPA/WebSPA.csproj index 0d79706e5..2d554810b 100644 --- a/src/Web/WebSPA/WebSPA.csproj +++ b/src/Web/WebSPA/WebSPA.csproj @@ -85,14 +85,14 @@ - + - - + + - + diff --git a/src/Web/WebStatus/Program.cs b/src/Web/WebStatus/Program.cs index e9f5a4453..11a4f02b9 100644 --- a/src/Web/WebStatus/Program.cs +++ b/src/Web/WebStatus/Program.cs @@ -23,6 +23,7 @@ namespace WebStatus builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); + builder.AddAzureWebAppDiagnostics(); }) .UseApplicationInsights() .UseSerilog((builderContext, config) => diff --git a/src/Web/WebStatus/Startup.cs b/src/Web/WebStatus/Startup.cs index b97ca1616..fbfa5e74c 100644 --- a/src/Web/WebStatus/Startup.cs +++ b/src/Web/WebStatus/Startup.cs @@ -39,7 +39,6 @@ namespace WebStatus // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); if (env.IsDevelopment()) @@ -89,7 +88,7 @@ namespace WebStatus if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer - services.EnableKubernetes(); + services.AddApplicationInsightsKubernetesEnricher(); } if (orchestratorType?.ToUpper() == "SF") { diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index 8bbb27b96..f2b912dbb 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -16,13 +16,13 @@ - - + + - - + + diff --git a/src/Web/WebhookClient/WebhookClient.csproj b/src/Web/WebhookClient/WebhookClient.csproj index fa4376c9d..895cbac54 100644 --- a/src/Web/WebhookClient/WebhookClient.csproj +++ b/src/Web/WebhookClient/WebhookClient.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj b/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj index f8fc3efaf..1d7ebd5a5 100644 --- a/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj +++ b/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj @@ -67,10 +67,13 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers +