Skip to content

Commit 6d063b3

Browse files
committed
Merge branch 'features/ep-migration-dotnet3' into features/migration-dotnet3
2 parents 58cf030 + 1e49084 commit 6d063b3

11 files changed

Lines changed: 53 additions & 54 deletions

File tree

src/Services/Location/Locations.API/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
1+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
5+
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
66
WORKDIR /src
77

88
COPY scripts scripts/

src/Services/Ordering/Ordering.API/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
1+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
5+
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
66
WORKDIR /src
77

88
COPY scripts scripts/

src/Services/Ordering/Ordering.API/Ordering.API.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
66
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
77
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
8-
<LangVersion>latest</LangVersion>
8+
<LangVersion>8.0</LangVersion>
99
</PropertyGroup>
1010

1111
<ItemGroup>
@@ -33,14 +33,13 @@
3333
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="$(AspNetCore_HealthChecks_SqlServer)" />
3434
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="$(AspNetCore_HealthChecks_UI_Client)" />
3535
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="$(Autofac_Extensions_DependencyInjection)" />
36-
<PackageReference Include="Dapper" Version="1.50.7" />
37-
<PackageReference Include="FluentValidation.AspNetCore" Version="7.5.0" />
36+
<PackageReference Include="Dapper" Version="$(Dapper)" />
37+
<PackageReference Include="FluentValidation.AspNetCore" Version="$(FluentValidation_AspNetCore)" />
3838
<PackageReference Include="MediatR" Version="$(MediatR)" />
39-
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="5.1.0" />
39+
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="$(MediatR_Extensions_Microsoft_DependencyInjection)" />
4040
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="$(Microsoft_ApplicationInsights_AspNetCore)" />
4141
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="$(Microsoft_ApplicationInsights_DependencyCollector)" />
4242
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="$(Microsoft_ApplicationInsights_Kubernetes)" />
43-
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.2.2" />
4443
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="$(Microsoft_AspNetCore_Diagnostics_HealthChecks)" />
4544
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="$(Microsoft_AspNetCore_HealthChecks)" />
4645
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="$(Microsoft_Extensions_Configuration_AzureKeyVault)" />
@@ -53,8 +52,9 @@
5352
<PackageReference Include="Serilog.Sinks.Seq" Version="$(Serilog_Sinks_Seq)" />
5453
<PackageReference Include="Serilog.Sinks.Http" Version="$(Serilog_Sinks_Http)" />
5554
<PackageReference Include="Swashbuckle.AspNetCore" Version="$(Swashbuckle_AspNetCore)" />
56-
<PackageReference Include="System.Reflection" Version="4.3.0" />
57-
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
55+
<PackageReference Include="System.Reflection" Version="$(System_Reflection)" />
56+
<PackageReference Include="System.ValueTuple" Version="$(System_ValueTuple)" />
57+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(Microsoft_AspNetCore_Authentication_JwtBearer)" />
5858
</ItemGroup>
5959
<ItemGroup>
6060
<None Update="Setup\*">

src/Services/Ordering/Ordering.API/Startup.cs

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
using global::Ordering.API.Application.IntegrationEvents.Events;
88
using global::Ordering.API.Infrastructure.Filters;
99
using global::Ordering.API.Infrastructure.Middlewares;
10+
using HealthChecks.UI.Client;
1011
using Infrastructure.AutofacModules;
1112
using Infrastructure.Filters;
1213
using Infrastructure.Services;
13-
using Microsoft.ApplicationInsights.Extensibility;
14-
using Microsoft.ApplicationInsights.ServiceFabric;
15-
using Microsoft.AspNetCore.Authentication.JwtBearer;
1614
using Microsoft.AspNetCore.Builder;
15+
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
1716
using Microsoft.AspNetCore.Hosting;
1817
using Microsoft.AspNetCore.Mvc;
1918
using Microsoft.Azure.ServiceBus;
@@ -26,18 +25,15 @@
2625
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services;
2726
using Microsoft.Extensions.Configuration;
2827
using Microsoft.Extensions.DependencyInjection;
28+
using Microsoft.Extensions.Diagnostics.HealthChecks;
2929
using Microsoft.Extensions.Logging;
3030
using Ordering.Infrastructure;
3131
using RabbitMQ.Client;
32-
using Swashbuckle.AspNetCore.Swagger;
3332
using System;
3433
using System.Collections.Generic;
3534
using System.Data.Common;
3635
using System.IdentityModel.Tokens.Jwt;
3736
using System.Reflection;
38-
using HealthChecks.UI.Client;
39-
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
40-
using Microsoft.Extensions.Diagnostics.HealthChecks;
4137

4238
public class Startup
4339
{
@@ -148,12 +144,6 @@ public static IServiceCollection AddApplicationInsights(this IServiceCollection
148144
// Enable K8s telemetry initializer
149145
services.AddApplicationInsightsKubernetesEnricher();
150146
}
151-
if (orchestratorType?.ToUpper() == "SF")
152-
{
153-
// Enable SF telemetry initializer
154-
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
155-
new FabricTelemetryInitializer());
156-
}
157147

158148
return services;
159149
}
@@ -249,23 +239,26 @@ public static IServiceCollection AddCustomSwagger(this IServiceCollection servic
249239
services.AddSwaggerGen(options =>
250240
{
251241
options.DescribeAllEnumsAsStrings();
252-
options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
242+
options.SwaggerDoc("v1", new OpenApi.Models.OpenApiInfo
253243
{
254244
Title = "Ordering HTTP API",
255245
Version = "v1",
256-
Description = "The Ordering Service HTTP API",
257-
TermsOfService = "Terms Of Service"
246+
Description = "The Ordering Service HTTP API"
258247
});
259248

260-
options.AddSecurityDefinition("oauth2", new OAuth2Scheme
249+
options.AddSecurityDefinition("oauth2", new OpenApi.Models.OpenApiSecurityScheme
261250
{
262-
Type = "oauth2",
263-
Flow = "implicit",
264-
AuthorizationUrl = $"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/authorize",
265-
TokenUrl = $"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/token",
266-
Scopes = new Dictionary<string, string>()
251+
Flows = new OpenApi.Models.OpenApiOAuthFlows()
267252
{
268-
{ "orders", "Ordering API" }
253+
Implicit = new OpenApi.Models.OpenApiOAuthFlow()
254+
{
255+
AuthorizationUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/authorize"),
256+
TokenUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/token"),
257+
Scopes = new Dictionary<string, string>()
258+
{
259+
{ "orders", "Ordering API" }
260+
}
261+
}
269262
}
270263
});
271264

@@ -407,8 +400,8 @@ public static IServiceCollection AddCustomAuthentication(this IServiceCollection
407400

408401
services.AddAuthentication(options =>
409402
{
410-
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
411-
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
403+
options.DefaultAuthenticateScheme = AspNetCore.Authentication.JwtBearer.JwtBearerDefaults.AuthenticationScheme;
404+
options.DefaultChallengeScheme = AspNetCore.Authentication.JwtBearer.JwtBearerDefaults.AuthenticationScheme;
412405

413406
}).AddJwtBearer(options =>
414407
{

src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
1+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
5+
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
66
WORKDIR /src
77

88
COPY scripts scripts/

src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<ItemGroup>
88
<PackageReference Include="MediatR" Version="$(MediatR)" />
9-
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="5.1.0" />
10-
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
9+
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="$(MediatR_Extensions_Microsoft_DependencyInjection)" />
10+
<PackageReference Include="System.Reflection.TypeExtensions" Version="$(System_Reflection_TypeExtensions)" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<ItemGroup>
1212
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(Microsoft_EntityFrameworkCore)" />
1313
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(Microsoft_EntityFrameworkCore_SqlServer)" />
14-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
14+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(Microsoft_Extensions_Logging_AzureAppServices)" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Services/Ordering/Ordering.SignalrHub/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
1+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
5+
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
66
WORKDIR /src
77

88
COPY scripts scripts/

src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
55
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
6+
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
7+
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
68
</PropertyGroup>
79

810
<ItemGroup>
@@ -17,20 +19,20 @@
1719
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="$(Microsoft_ApplicationInsights_AspNetCore)" />
1820
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="$(Microsoft_ApplicationInsights_DependencyCollector)" />
1921
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="$(Microsoft_ApplicationInsights_Kubernetes)" />
20-
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.2.2" />
2122
<PackageReference Include="Microsoft.AspNetCore.App" />
2223
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="$(Microsoft_AspNetCore_Diagnostics_HealthChecks)" />
2324
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="$(Microsoft_AspNetCore_HealthChecks)" />
24-
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
25-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Core" Version="1.1.0" />
26-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Redis" Version="1.1.0" />
25+
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="$(Microsoft_AspNetCore_SignalR)" />
26+
<PackageReference Include="Microsoft.AspNetCore.SignalR.Core" Version="$(Microsoft_AspNetCore_SignalR.Core)" />
27+
<PackageReference Include="Microsoft.AspNetCore.SignalR.Redis" Version="$(Microsoft_AspNetCore_SignalR.Redis)" />
2728
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="$(Microsoft_Extensions_Logging_AzureAppServices)" />
2829
<PackageReference Include="Serilog.AspNetCore" Version="$(Serilog_AspNetCore)" />
2930
<PackageReference Include="Serilog.Enrichers.Environment" Version="$(Serilog_Enrichers_Environment)" />
3031
<PackageReference Include="Serilog.Settings.Configuration" Version="$(Serilog_Settings_Configuration)" />
3132
<PackageReference Include="Serilog.Sinks.Console" Version="$(Serilog_Sinks_Console)" />
3233
<PackageReference Include="Serilog.Sinks.Seq" Version="$(Serilog_Sinks_Seq)" />
3334
<PackageReference Include="Serilog.Sinks.Http" Version="$(Serilog_Sinks_Http)" />
35+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(Microsoft_AspNetCore_Authentication_JwtBearer)" />
3436
</ItemGroup>
3537

3638
<ItemGroup>

src/Services/Ordering/Ordering.SignalrHub/Startup.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
using Autofac;
22
using Autofac.Extensions.DependencyInjection;
3-
using Microsoft.AspNetCore.Authentication.JwtBearer;
3+
using HealthChecks.UI.Client;
44
using Microsoft.AspNetCore.Builder;
5+
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
56
using Microsoft.Azure.ServiceBus;
67
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
78
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
89
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
910
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus;
1011
using Microsoft.Extensions.Configuration;
1112
using Microsoft.Extensions.DependencyInjection;
13+
using Microsoft.Extensions.Diagnostics.HealthChecks;
1214
using Microsoft.Extensions.Logging;
1315
using Ordering.SignalrHub.AutofacModules;
1416
using Ordering.SignalrHub.IntegrationEvents;
@@ -17,9 +19,6 @@
1719
using RabbitMQ.Client;
1820
using System;
1921
using System.IdentityModel.Tokens.Jwt;
20-
using HealthChecks.UI.Client;
21-
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
22-
using Microsoft.Extensions.Diagnostics.HealthChecks;
2322

2423
namespace Ordering.SignalrHub
2524
{

0 commit comments

Comments
 (0)