Conversation
Take advantage of the new Aspire.Hosting.Yarp integration and remove the Mobile.Bff.Shopping service. Remove unnecessary package references and versions
| // } | ||
| #pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. | ||
| IResourceBuilder<ParameterResource>? endpoint = null; | ||
| if (openAITarget != OpenAITarget.OpenAI) |
There was a problem hiding this comment.
@davidfowl - what's your thoughts on this new structure/behavior?
There was a problem hiding this comment.
Looks much better. I think you need to set p.Description though (since you are overriding the input with WithCustomInput).
There was a problem hiding this comment.
I think you need to set p.Description though
I am calling .WithDescription("The Azure OpenAI endpoint to use, e.g. https://<name>.openai.azure.com/") on both.
|
The YARP part LGTM, maybe some routes could be grouped, but having them distinct help readability. |
Yeah - I just directly translated the json routes directly to C#. |
| return builder; | ||
| } | ||
|
|
||
| public static IResourceBuilder<YarpResource> ConfigureMobileBffRoutes(this IResourceBuilder<YarpResource> builder, |
|
9.4.0 has shipped, marking as ready for review |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the eShop application to use Aspire 9.4 preview, taking advantage of the new Aspire.Hosting.Yarp integration to replace the Mobile.Bff.Shopping service with native YARP support. The changes modernize the application's architecture by removing the dedicated BFF service and using Aspire's built-in reverse proxy capabilities.
- Updates Aspire SDK versions from 9.2.0 to 9.4.0-preview.1.25367.4
- Replaces Mobile.Bff.Shopping project with Aspire's native YARP integration
- Removes unnecessary package dependencies and updates package versions
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj | Updates Aspire.AppHost.Sdk to 9.4 preview |
| tests/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj | Updates Aspire.AppHost.Sdk to 9.4 preview |
| src/eShop.AppHost/eShop.AppHost.csproj | Adds Aspire.Hosting.Yarp package and removes Mobile.Bff.Shopping reference |
| src/eShop.AppHost/Program.cs | Replaces Mobile.Bff.Shopping project with AddYarp configuration |
| src/eShop.AppHost/Extensions.cs | Adds YARP configuration methods and refactors OpenAI integration |
| src/WebApp/WebApp.csproj | Removes redundant Microsoft.Extensions.AI packages |
| src/WebApp/Program.cs | Updates MapForwarder to use https+http scheme |
| src/Mobile.Bff.Shopping/* | Removes entire Mobile.Bff.Shopping project |
| eShop.slnx | Adds new solution file in XML format |
| eShop.sln | Removes traditional solution file |
| eShop.Web.slnf | Updates solution filter to reference new solution file |
| Directory.Packages.props | Updates package versions and removes unused dependencies |
Comments suppressed due to low confidence (2)
src/eShop.AppHost/eShop.AppHost.csproj:2
- The version '9.4.0-preview.1.25367.4' is a preview version. Consider verifying this exact version exists and is stable for production use, as preview versions may not be available in all environments.
<Sdk Name="Aspire.AppHost.Sdk" Version="9.4.0-preview.1.25367.4" />
Directory.Packages.props:8
- The AspireUnstablePackagesVersion '9.4.0-preview.1.25378.8' is a preview version that may not be stable or widely available. Verify this version exists in the package feed.
<AspireUnstablePackagesVersion>9.4.0-preview.1.25378.8</AspireUnstablePackagesVersion>
| yarp.AddRoute("/api/orders/{*any}", orderingApi.GetEndpoint("http")) | ||
| .WithMatchRouteQueryParameter([new() { Name = "api-version", Values = ["1.0", "1"], Mode = QueryParameterMatchMode.Exact }]); | ||
|
|
||
| // Identity routes | ||
| yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint("http")) |
There was a problem hiding this comment.
[nitpick] The route configuration uses hardcoded endpoint scheme 'http'. Consider making this configurable or using a more flexible approach that supports both HTTP and HTTPS endpoints.
| yarp.AddRoute("/api/orders/{*any}", orderingApi.GetEndpoint("http")) | |
| .WithMatchRouteQueryParameter([new() { Name = "api-version", Values = ["1.0", "1"], Mode = QueryParameterMatchMode.Exact }]); | |
| // Identity routes | |
| yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint("http")) | |
| var endpointScheme = GetEndpointScheme(); | |
| yarp.AddRoute("/api/orders/{*any}", orderingApi.GetEndpoint(endpointScheme)) | |
| .WithMatchRouteQueryParameter([new() { Name = "api-version", Values = ["1.0", "1"], Mode = QueryParameterMatchMode.Exact }]); | |
| // Identity routes | |
| yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint(endpointScheme)) |
| .WithMatchRouteQueryParameter([new() { Name = "api-version", Values = ["1.0", "1"], Mode = QueryParameterMatchMode.Exact }]); | ||
|
|
||
| // Identity routes | ||
| yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint("http")) |
There was a problem hiding this comment.
[nitpick] Similar to the ordering route, the identity route also uses a hardcoded 'http' endpoint scheme. Consider using a consistent approach for endpoint configuration across all routes.
| yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint("http")) | |
| var identityApiScheme = Configuration["IdentityApiScheme"] ?? "http"; | |
| yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint(identityApiScheme)) |
Take advantage of the new Aspire.Hosting.Yarp integration and remove the Mobile.Bff.Shopping service. Remove unnecessary package references and versions.
In draft until 9.4 is released.