Skip to content

Commit 8f25954

Browse files
Updates for 9.2 (#766)
* Update package refs to 9.2 * Update NuGet.config * Update Microsoft.Extensions.Http.Resilience version * Update ImageGallery.AppHost.csproj * Fix containerbuild sample * Fix metrics sample * Disable logs error checking in tests * Increase timeout for StopAsync() calls in tests * Update to latest build * Increase timeouts * Update CI definition - Install latest docker - Enable DCP logs * Update env vars & use specific otel collector image tag * Update service defaults * Update client apps sample * Reenable checking for errors in test logs * DatabaseContainers: MSSQL use new database creation script feature * Disable log error checking in tests again * Fix DatabaseContainers * Customize URLs for AspireShop frontend * Remove SQL retry workaround in migrations sample * Remove <IsAspireHost> * VolumeMount: Remove SQL retry workaround * Update standalone dashboard readme * Remove redundant call * Remove workaround for fixed bug * Update to stable packages * Update ImageGallery.AppHost.csproj
1 parent 087130c commit 8f25954

File tree

94 files changed

+414
-439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+414
-439
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ jobs:
3030
DOTNET_INSTALL_DIR: ${{ matrix.os == 'ubuntu-latest' && '' || 'dotnet' }}
3131
ASPIRE_ALLOW_UNSECURED_TRANSPORT: true
3232
SuppressNETCoreSdkPreviewMessage: true
33+
DCP_DIAGNOSTICS_LOG_LEVEL: 'debug'
3334
steps:
3435
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
37+
- name: Install Docker (latest version)
38+
if: matrix.os == 'ubuntu-latest'
39+
uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19 #v4.3.0
3540

3641
- name: Install Azure Functions Core Tools
3742
if: matrix.os == 'ubuntu-latest'
@@ -75,6 +80,12 @@ jobs:
7580
--results-directory ./TestResults --blame
7681
--
7782
RunConfiguration.CollectSourceInformation=true
83+
84+
- name: Copy DCP logs
85+
if: (success() || steps.test.conclusion == 'failure') && matrix.os == 'ubuntu-latest'
86+
run: |
87+
mkdir -p ./TestResults/DCPLogs
88+
cp -r /tmp/dcp/logs/* ./TestResults/DCPLogs
7889
7990
- name: Publish Test Results
8091
if: (success() || steps.test.conclusion == 'failure') && matrix.os == 'ubuntu-latest'

samples/AspireShop/AspireShop.AppHost/AspireShop.AppHost.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Sdk Name="Aspire.AppHost.Sdk" Version="9.1.0" />
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.2.0" />
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
77
<TargetFramework>net8.0</TargetFramework>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<Nullable>enable</Nullable>
10-
<IsAspireHost>true</IsAspireHost>
1110
<UserSecretsId>1d56e163-c575-42ac-a0a7-c6484d1729d9</UserSecretsId>
1211
</PropertyGroup>
1312

1413
<ItemGroup>
15-
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.1.0" />
16-
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="9.1.0" />
17-
<PackageReference Include="Aspire.Hosting.Redis" Version="9.1.0" />
14+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.2.0" />
15+
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="9.2.0" />
16+
<PackageReference Include="Aspire.Hosting.Redis" Version="9.2.0" />
1817
<ProjectReference Include="..\AspireShop.BasketService\AspireShop.BasketService.csproj" />
1918
<ProjectReference Include="..\AspireShop.CatalogDbManager\AspireShop.CatalogDbManager.csproj" />
2019
<ProjectReference Include="..\AspireShop.CatalogService\AspireShop.CatalogService.csproj" />

samples/AspireShop/AspireShop.AppHost/Program.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@
2020
.WithReference(catalogDb)
2121
.WaitFor(catalogDb)
2222
.WithHttpHealthCheck("/health")
23-
.WithHttpCommand("/reset-db", "Reset Database", iconName: "DatabaseLightning");
23+
.WithHttpCommand("/reset-db", "Reset Database", commandOptions: new() { IconName = "DatabaseLightning" });
2424

2525
var catalogService = builder.AddProject<Projects.AspireShop_CatalogService>("catalogservice")
2626
.WithReference(catalogDb)
27-
.WaitFor(catalogDbManager);
27+
.WaitFor(catalogDbManager)
28+
.WithHttpHealthCheck("/health");
2829

2930
var basketService = builder.AddProject<Projects.AspireShop_BasketService>("basketservice")
3031
.WithReference(basketCache)
3132
.WaitFor(basketCache);
3233

3334
builder.AddProject<Projects.AspireShop_Frontend>("frontend")
3435
.WithExternalHttpEndpoints()
36+
.WithUrlForEndpoint("https", url => url.DisplayText = "Online Store (HTTPS)")
37+
.WithUrlForEndpoint("http", url => url.DisplayText = "Online Store (HTTP)")
38+
.WithHttpHealthCheck("/health")
3539
.WithReference(basketService)
3640
.WithReference(catalogService)
3741
.WaitFor(catalogService);

samples/AspireShop/AspireShop.AppHost/Properties/launchSettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"environmentVariables": {
1010
"ASPNETCORE_ENVIRONMENT": "Development",
1111
"DOTNET_ENVIRONMENT": "Development",
12-
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16224",
13-
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22123"
12+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16224",
13+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22123"
1414
}
1515
},
1616
"http": {
@@ -21,8 +21,8 @@
2121
"environmentVariables": {
2222
"ASPNETCORE_ENVIRONMENT": "Development",
2323
"DOTNET_ENVIRONMENT": "Development",
24-
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16223",
25-
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:21123"
24+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16223",
25+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:21123"
2626
}
2727
}
2828
}

samples/AspireShop/AspireShop.AppHost/ResourceBuilderExtensions.cs

Lines changed: 0 additions & 73 deletions
This file was deleted.

samples/AspireShop/AspireShop.BasketService/AspireShop.BasketService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="Grpc.AspNetCore" Version="2.70.0" />
1111
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.70.0" />
12-
<PackageReference Include="Aspire.StackExchange.Redis" Version="9.1.0" />
12+
<PackageReference Include="Aspire.StackExchange.Redis" Version="9.2.0" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

samples/AspireShop/AspireShop.CatalogDb/AspireShop.CatalogDb.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.1.0" />
10+
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.2.0" />
1111
</ItemGroup>
1212

1313
</Project>

samples/AspireShop/AspireShop.CatalogDbManager/AspireShop.CatalogDbManager.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.1.0" />
10+
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.2.0" />
1111
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.13">
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

samples/AspireShop/AspireShop.CatalogService/AspireShop.CatalogService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
1616
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
17-
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.1.0" />
17+
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.2.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

samples/AspireShop/AspireShop.Frontend/AspireShop.Frontend.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="9.1.0" />
10+
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="9.2.0" />
1111
<PackageReference Include="Yarp.ReverseProxy" Version="2.3.0" />
1212
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.70.0" />
1313
<PackageReference Include="Grpc.Tools" Version="2.71.0">

samples/AspireShop/AspireShop.ServiceDefaults/AspireShop.ServiceDefaults.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<ItemGroup>
1212
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1313

14-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.2.0" />
15-
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.1.0" />
14+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.3.0" />
15+
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.2.0" />
1616
<!-- Open Telemetry -->
1717
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
1818
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />

samples/AspireShop/AspireShop.ServiceDefaults/Extensions.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ namespace Microsoft.Extensions.Hosting;
1111

1212
public static class Extensions
1313
{
14+
private const string HealthEndpointPath = "/health";
15+
private const string AlivenessEndpointPath = "/alive";
16+
1417
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder)
1518
{
1619
builder.ConfigureOpenTelemetry();
@@ -48,12 +51,13 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati
4851
})
4952
.WithTracing(tracing =>
5053
{
51-
tracing.AddSource(builder.Environment.ApplicationName)
54+
tracing
55+
.AddSource(builder.Environment.ApplicationName)
5256
.AddAspNetCoreInstrumentation(tracing =>
5357
// Don't trace requests to the health endpoint to avoid filling the dashboard with noise
5458
tracing.Filter = httpContext =>
55-
!(httpContext.Request.Path.StartsWithSegments("/health")
56-
|| httpContext.Request.Path.StartsWithSegments("/alive"))
59+
!(httpContext.Request.Path.StartsWithSegments(HealthEndpointPath)
60+
|| httpContext.Request.Path.StartsWithSegments(AlivenessEndpointPath))
5761
)
5862
.AddGrpcClientInstrumentation()
5963
.AddHttpClientInstrumentation();
@@ -92,10 +96,10 @@ public static WebApplication MapDefaultEndpoints(this WebApplication app)
9296
if (app.Environment.IsDevelopment())
9397
{
9498
// All health checks must pass for app to be considered ready to accept traffic after starting
95-
app.MapHealthChecks("/health");
99+
app.MapHealthChecks(HealthEndpointPath);
96100

97101
// Only health checks tagged with the "live" tag must pass for app to be considered alive
98-
app.MapHealthChecks("/alive", new HealthCheckOptions
102+
app.MapHealthChecks(AlivenessEndpointPath, new HealthCheckOptions
99103
{
100104
Predicate = r => r.Tags.Contains("live")
101105
});

samples/AspireWithAzureFunctions/ImageGallery.AppHost/ImageGallery.AppHost.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Sdk Name="Aspire.AppHost.Sdk" Version="9.1.0" />
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.2.0" />
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
77
<TargetFramework>net9.0</TargetFramework>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<Nullable>enable</Nullable>
10-
<IsAspireHost>true</IsAspireHost>
1110
<UserSecretsId>e4145abc-ffce-4abc-8946-4083dce0f67e</UserSecretsId>
1211
</PropertyGroup>
1312

1413
<ItemGroup>
15-
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.1.0" />
16-
<PackageReference Include="Aspire.Hosting.Azure.Storage" Version="9.1.0" />
17-
<PackageReference Include="Aspire.Hosting.Azure.Functions" Version="9.1.0-preview.1.25121.10" />
14+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.2.0" />
15+
<PackageReference Include="Aspire.Hosting.Azure.Storage" Version="9.2.0" />
16+
<PackageReference Include="Aspire.Hosting.Azure.Functions" Version="9.2.0-preview.1.25209.2" />
1817
</ItemGroup>
1918

2019
<ItemGroup>

samples/AspireWithAzureFunctions/ImageGallery.AppHost/Properties/launchSettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"environmentVariables": {
1010
"ASPNETCORE_ENVIRONMENT": "Development",
1111
"DOTNET_ENVIRONMENT": "Development",
12-
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21185",
13-
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22082"
12+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21185",
13+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22082"
1414
}
1515
},
1616
"http": {
@@ -21,8 +21,8 @@
2121
"environmentVariables": {
2222
"ASPNETCORE_ENVIRONMENT": "Development",
2323
"DOTNET_ENVIRONMENT": "Development",
24-
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19237",
25-
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20196"
24+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19237",
25+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20196"
2626
}
2727
}
2828
}

samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/ImageGallery.FrontEnd.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Aspire.Azure.Storage.Queues" Version="9.1.0" />
11-
<PackageReference Include="Aspire.Azure.Storage.Blobs" Version="9.1.0" />
10+
<PackageReference Include="Aspire.Azure.Storage.Queues" Version="9.2.0" />
11+
<PackageReference Include="Aspire.Azure.Storage.Blobs" Version="9.2.0" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/AspireWithAzureFunctions/ImageGallery.Functions/ImageGallery.Functions.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.6.1" />
1515
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" Version="5.5.1" />
1616
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.1" />
17-
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.10.0" />
18-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.2" />
19-
<PackageReference Include="Aspire.Azure.Storage.Blobs" Version="9.1.0" />
20-
<PackageReference Include="Aspire.Azure.Storage.Queues" Version="9.1.0" />
17+
<PackageReference Include="Aspire.Azure.Storage.Blobs" Version="9.2.0" />
18+
<PackageReference Include="Aspire.Azure.Storage.Queues" Version="9.2.0" />
2119
<PackageReference Include="SkiaSharp" Version="3.116.1" />
2220
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.116.1" />
2321
</ItemGroup>

samples/AspireWithAzureFunctions/ImageGallery.ServiceDefaults/Extensions.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ namespace Microsoft.Extensions.Hosting;
1515
// To learn more about using this project, see https://aka.ms/dotnet/aspire/service-defaults
1616
public static class Extensions
1717
{
18+
private const string HealthEndpointPath = "/health";
19+
private const string AlivenessEndpointPath = "/alive";
20+
1821
public static TBuilder AddServiceDefaults<TBuilder>(this TBuilder builder) where TBuilder : IHostApplicationBuilder
1922
{
2023
builder.ConfigureOpenTelemetry();
@@ -58,8 +61,14 @@ public static TBuilder ConfigureOpenTelemetry<TBuilder>(this TBuilder builder) w
5861
})
5962
.WithTracing(tracing =>
6063
{
61-
tracing.AddSource(builder.Environment.ApplicationName)
62-
.AddAspNetCoreInstrumentation()
64+
tracing
65+
.AddSource(builder.Environment.ApplicationName)
66+
.AddAspNetCoreInstrumentation(tracing =>
67+
// Don't trace requests to the health endpoint to avoid filling the dashboard with noise
68+
tracing.Filter = httpContext =>
69+
!(httpContext.Request.Path.StartsWithSegments(HealthEndpointPath)
70+
|| httpContext.Request.Path.StartsWithSegments(AlivenessEndpointPath))
71+
)
6372
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
6473
//.AddGrpcClientInstrumentation()
6574
.AddHttpClientInstrumentation();
@@ -105,10 +114,10 @@ public static WebApplication MapDefaultEndpoints(this WebApplication app)
105114
if (app.Environment.IsDevelopment())
106115
{
107116
// All health checks must pass for app to be considered ready to accept traffic after starting
108-
app.MapHealthChecks("/health");
117+
app.MapHealthChecks(HealthEndpointPath);
109118

110119
// Only health checks tagged with the "live" tag must pass for app to be considered alive
111-
app.MapHealthChecks("/alive", new HealthCheckOptions
120+
app.MapHealthChecks(AlivenessEndpointPath, new HealthCheckOptions
112121
{
113122
Predicate = r => r.Tags.Contains("live")
114123
});

samples/AspireWithAzureFunctions/ImageGallery.ServiceDefaults/ImageGallery.ServiceDefaults.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<ItemGroup>
1111
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1212

13-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.2.0" />
14-
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.1.0" />
13+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.3.0" />
14+
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.2.0" />
1515
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.11.2" />
1616
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.11.2" />
1717
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.11.1" />

0 commit comments

Comments
 (0)