Skip to content

Update eshop to Aspire 9.4#858

Merged
joperezr merged 7 commits intodotnet:mainfrom
eerhardt:Update9.4
Jul 29, 2025
Merged

Update eshop to Aspire 9.4#858
joperezr merged 7 commits intodotnet:mainfrom
eerhardt:Update9.4

Conversation

@eerhardt
Copy link
Member

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.

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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidfowl - what's your thoughts on this new structure/behavior?

Copy link
Member

@davidfowl davidfowl Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better. I think you need to set p.Description though (since you are overriding the input with WithCustomInput).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@benjaminpetit
Copy link
Member

The YARP part LGTM, maybe some routes could be grouped, but having them distinct help readability.

@eerhardt
Copy link
Member Author

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjaminpetit can this be simplified?

@joperezr joperezr marked this pull request as ready for review July 29, 2025 20:58
Copilot AI review requested due to automatic review settings July 29, 2025 20:58
@joperezr
Copy link
Member

9.4.0 has shipped, marking as ready for review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment on lines +233 to +237
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"))
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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))

Copilot uses AI. Check for mistakes.
.WithMatchRouteQueryParameter([new() { Name = "api-version", Values = ["1.0", "1"], Mode = QueryParameterMatchMode.Exact }]);

// Identity routes
yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint("http"))
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint("http"))
var identityApiScheme = Configuration["IdentityApiScheme"] ?? "http";
yarp.AddRoute("/identity/{*any}", identityApi.GetEndpoint(identityApiScheme))

Copilot uses AI. Check for mistakes.
@joperezr joperezr merged commit 1c90ec9 into dotnet:main Jul 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments