Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Add how-to guide for adopting Aspire in existing applications

✅ All Feedback Addressed

Addresses #60 by documenting the gradual adoption path for adding Aspire orchestration to existing .NET applications using aspire init.

Changes

New how-to guide

  • Added /get-started/add-aspire-existing-app/ covering the incremental adoption workflow
  • Explains file-based AppHost (apphost.cs) created by aspire init
  • Documents the three-phase optional approach: aspire init → ServiceDefaults → integrations
  • Supports polyglot applications (C#, Python, JavaScript)

Key sections

  • Initialize: aspire init interactive mode walkthrough for creating file-based AppHost
  • Add applications: Register C#, Python, and JavaScript applications
  • Telemetry: Optional OpenTelemetry configuration for all languages
  • Integrations: Example migration using Redis with automatic configuration injection
  • Verification: Running with aspire run and dashboard exploration

Latest fixes

  • ✅ Added missing PeriodicExportingMetricReader import to JavaScript telemetry example (commit d9bfcd4)
  • ✅ Added "How-to" badge back to sidebar navigation with translations (commit current)

Configuration injection

Explains how Aspire's AppHost automatically injects configuration from hosting integrations into dependent resources:

  • Connection strings
  • URLs
  • Environment variables
  • Service-specific settings

These are passed through .NET's standard configuration system, eliminating manual connection string management.

Example: Adding Redis integration

// AppHost: Add Redis resource
var cache = builder.AddRedis("cache");
var api = builder.AddProject<Projects.YourApi>("api")
    .WithReference(cache);  // Aspire injects connection info automatically

// Service: Configure client
builder.AddRedisClient("cache");  // Connection string injected via configuration

Navigation

  • Added to sidebar under "Get started" with "How-to" badge
  • Includes translations for 15 languages
  • Links to CLI reference documentation throughout

Sidebar with How-to badge

The guide emphasizes minimal code changes and non-invasive integration, addressing the OP's request for "where to start from" and "how to do this gradually."

Original prompt

Please start a draft PR to address #60 - use aspire init and describe what that does, link to cli reference in a learn more. Consider everything the op is specifically asking for and also have a look at what we've done on Learn from this here https://learn.microsoft.com/dotnet/aspire/get-started/add-aspire-existing-app


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 19, 2025 05:29
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for aspire init command Add tutorial for adopting Aspire in existing .NET applications Nov 19, 2025
Copilot AI requested a review from IEvangelist November 19, 2025 05:36
Copilot finished work on behalf of IEvangelist November 19, 2025 05:36
Copy link
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

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

Hey @copilot, please address feedback.

…Host, add config injection explanation

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

Hey @copilot, please address feedback.

All feedback addressed in commit 11c311f:

  • Changed badge to "How-to" with translations
  • Removed project-based AppHost references (only file-based apphost.cs)
  • Added configuration injection explanation
  • Fixed mark highlighting

Updated page

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/.npm/_npx/aa98e6899c6baff3/node_modules/.bin/astro build (dns block)
    • Triggering command: node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add tutorial for adopting Aspire in existing .NET applications Add how-to guide for adopting Aspire in existing .NET applications Nov 19, 2025
Copilot AI requested a review from IEvangelist November 19, 2025 14:40
Copilot finished work on behalf of IEvangelist November 19, 2025 14:40
@IEvangelist IEvangelist changed the title Add how-to guide for adopting Aspire in existing .NET applications Add how-to guide for adopting Aspire in existing applications Nov 19, 2025
@IEvangelist IEvangelist marked this pull request as ready for review November 19, 2025 17:15
Copilot AI review requested due to automatic review settings November 19, 2025 17:15
Copilot finished reviewing on behalf of IEvangelist November 19, 2025 17:18
Copy link
Contributor

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 adds a comprehensive how-to guide for adopting Aspire orchestration in existing applications. The guide demonstrates using aspire init to incrementally add Aspire to C#, Python, and JavaScript applications without requiring a full rewrite.

Key changes:

  • New documentation file explaining the gradual adoption workflow using file-based AppHosts
  • Updated InstallPackage component to support omitting PackageReference tab for certain scenarios
  • Added sidebar navigation entry with internationalized translations across 15 languages

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/frontend/src/content/docs/get-started/add-aspire-existing-app.mdx Complete how-to guide covering aspire init, polyglot orchestration, telemetry setup, and integrations
src/frontend/src/components/InstallPackage.astro Added optional omitPackageReference prop to conditionally hide PackageReference tab
src/frontend/sidebar.topics.ts Added sidebar entry with translations for the new guide
src/frontend/src/data/aspire-integrations.json Updated NuGet package download counts (automated update)
Comments suppressed due to low confidence (1)

src/frontend/src/components/InstallPackage.astro:31

  • The title variable uses AppHost.cs (uppercase) but the tab label on line 54 uses apphost.cs (lowercase). For consistency with file-based AppHosts, the title should be C# — apphost.cs to match the lowercase convention used throughout the codebase for file-based AppHosts.
const appHostTitle = `C# — AppHost.cs`;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IEvangelist
Copy link
Member

@copilot apply changes based on the comments in this thread

…try example

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot apply changes based on the comments in this thread

Added the "How-to" badge back to the sidebar navigation with variant "note" and translations for all 15 languages in commit fbac9b8.

Sidebar showing How-to badge

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Contributor

@Meir017 Meir017 left a comment

Choose a reason for hiding this comment

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

Minor comments here

…app.mdx

Co-authored-by: Meir Blachman <meirblachman@gmail.com>
@Meir017
Copy link
Contributor

Meir017 commented Nov 19, 2025

@IEvangelist It might be better to have a single location that describes the requirements for aspire (.NET version and IDEs) abd then reference it, instead of having minimal instructions in multiple pages

@IEvangelist
Copy link
Member

@IEvangelist It might be better to have a single location that describes the requirements for aspire (.NET version and IDEs) abd then reference it, instead of having minimal instructions in multiple pages

You're right! This is what we did on Learn, where we had a Setup and tooling doc with environment selector. Seems similar to what @mitchdenny was suggesting here too in #64.

@IEvangelist IEvangelist merged commit a20a92e into main Nov 20, 2025
5 of 7 checks passed
@IEvangelist IEvangelist deleted the copilot/add-aspire-init-documentation branch November 20, 2025 16:50
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