Skip to content

Update samples for Aspire 13.1-13.3 APIs #1626

Description

@davidfowl

Summary

Track follow-up work to update selected samples for new Aspire APIs and behaviors introduced in Aspire 13.1, 13.2, and 13.3.

References:

Todo

  • Add browser telemetry to frontend samples using Aspire.Hosting.Browsers and WithBrowserLogs() so browser console logs, network requests, and screenshots appear in the Aspire dashboard.

    • Candidate samples: image-gallery, aspire-with-python, aspire-with-node, aspire-with-javascript, vite-csharp-postgres, vite-react-fastapi, node-express-redis, polyglot-task-queue, rag-document-qa-svelte.
  • Replace older JavaScript publish patterns with Aspire 13.3 JavaScript publishing APIs where appropriate.

    • Consider PublishAsStaticWebsite, PublishAsNodeServer, and PublishAsNpmScript.
    • Candidate samples: aspire-with-javascript currently uses PublishAsDockerFile() for Angular/React/Vue; several Vite samples still embed frontend build output via PublishWithContainerFiles(...).
  • Explicitly bind every deployable resource to its compute environment with WithComputeEnvironment(...).

    • This is required for Azure, Kubernetes, and Compose deployment clarity in Aspire 13.3+.
    • Candidate samples: image-gallery, aspire-with-azure-functions, and any other sample that declares a deployment environment such as AddAzureContainerAppEnvironment(...), AddKubernetesEnvironment(...), or AddDockerComposeEnvironment(...).
  • Consider demonstrating the Aspire 13.1 Azure Functions non-generic overload AddAzureFunctionsProject(name, projectPath).

    • Candidate sample: aspire-with-azure-functions.
  • Refresh the custom resources sample to show newer lifecycle and command APIs.

    • Consider SubscribeBeforeStart, SubscribeAfterResourcesCreated, structured command results, and ExecuteCommandContext.Logger.
    • Candidate sample: custom-resources.
  • Remove redundant explicit Aspire.Hosting.AppHost package references from AppHost project files where the Aspire.AppHost.Sdk already supplies the AppHost package.

Notes

The samples are already largely using Aspire 13.3.3 packages, so this is primarily about showcasing newer APIs and recommended patterns rather than broad package version updates.

WithHttpsDeveloperCertificate() does not need to be added to Vite samples because Aspire now handles that behavior implicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions