Skip to content

docs: Add App Model API documentation for CORS, console apps, resource naming, and networking - #454

Open
David Pine (IEvangelist) with Copilot wants to merge 1 commit into
mainfrom
copilot/add-docs-for-app-model-api
Open

docs: Add App Model API documentation for CORS, console apps, resource naming, and networking#454
David Pine (IEvangelist) with Copilot wants to merge 1 commit into
mainfrom
copilot/add-docs-for-app-model-api

Conversation

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Addresses gaps identified from 20K+ Discord community messages where users had no documentation for several common AppHost scenarios.

New pages

  • app-host/resource-naming.mdx — How resource names map to env vars (ConnectionStrings__<name>, services__<name>__<endpoint>__0), the dash→underscore transformation (my-serviceConnectionStrings__my_service), naming best practices (dashes preferred, underscores valid), and resource name validation rules (links to ASPIRE006 diagnostic).

  • app-host/console-apps.mdx — Adding .NET console/worker projects to AppHost via AddProject, plus links to AddExecutable, AddPythonApp, and AddNodeApp for non-.NET apps. Covers wiring service discovery on non-ASP.NET Core hosts, BackgroundService patterns, WithExplicitStart() for interactive apps, and dashboard console output.

  • app-host/cors-configuration.mdx — When CORS is (and isn't) needed with Aspire, ASP.NET Core Minimal API middleware setup with AddCors/UseCors, environment-based origins, using WithReference(frontend) to auto-inject the frontend URL into API CORS config, common failure patterns (middleware ordering, preflight, credentials), and dashboard CORS env var.

Updated pages

  • fundamentals/networking-overview.mdx — Two new sections:
    • Binding to all interfaces for LAN access — 0.0.0.0 configuration for ASP.NET Core projects, containers (clarifying WithHttpEndpoint maps ports only; the app must also bind via WithEnvironment), and executables
    • Container-to-host networking — host gateway address platform table, WithReference for automatic cross-platform host resolution, AddConnectionString for existing host services, and KnownNetworkIdentifiers

Sidebar

Added all three new pages under the AppHost section in docs.topics.ts with Japanese (ja) translations.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Discord Feedback] App Model API gaps - CORS, console apps, naming, networking</issue_title>
<issue_description>## Summary

Based on analysis of 20,415 Discord messages + 147 #help threads from the Aspire community (April 2025 - February 2026), several App Model API features lack documentation.

Missing Documentation

1. CORS Configuration (10+ questions)

Current State: Zero documentation

Customer Quotes:

"Wait.. hold on, hold on, hold on, hold on, hold on.... What? do we need to configure cors?"

"I seem to be having some CORS issues with a test deployment. Would this also have to be something I configure somewhere in my project?"

Requested Documentation:

  • When CORS configuration is needed with Aspire
  • How to configure CORS for dev vs prod
  • Common CORS issues and solutions

2. Console Application Integration (17 questions)

Customer Quotes:

"if I want to hook up a Console project with Aspire, so that it can still (maybe?) use service discovery, service defaults, etc. with Aspire resources... is that possible?"

"Colleague asked how to start a console app with aspire. I got it to connect to another resource (redis) and write a kv.... but then was wondering how to 'launch the console window' so one could interact with Console.Readline."

Requested Documentation:

  • Adding Console apps to Aspire AppHost
  • Service discovery in Console apps (non-ASP.NET Core)
  • Background worker / hosted service patterns
  • Interactive console apps with stdin/stdout

3. Resource Naming Conventions

Customer Quote:

"How does WithReference treat names that have dashes? e.g. AddWhatever("my-service") and then will it be like MY_SERVICE_[PROPERTY]? Or MY-SERVICE_[PROPERTY]?"

Requested Documentation:

  • How resource names map to environment variables
  • Dashes → underscores transformation rules
  • Best practices for naming resources

4. Network Binding (0.0.0.0 / LAN Access)

From #help thread: "How to bind services to 0.0.0.0 for LAN access?"

Requested Documentation:

  • Exposing services to external network
  • Binding to 0.0.0.0 vs localhost
  • LAN development scenarios

5. Container-to-Host Networking

Customer Quote:

"I'm struggling to get endpoints resolved in the context of a container. If I use KnownNetworkIdentifiers.LocalhostNetwork, it always comes back with localhost not host.docker.internal"

From #help: "Containers can't reach localhost SQL"

Requested Documentation:

  • host.docker.internal behavior
  • KnownNetworkIdentifiers enum usage
  • Container-to-localhost SQL Server connectivity

Data Source

  • Discord channels: #💫│general, #🔵│azure, #🔨│building-resources
  • Help threads: 147 analyzed from #🆘│help
  • Total messages: 20,415
  • Date range: April 2025 - February 2026</issue_description>

<agent_instructions>Please address this issue, while using the .github/skills/doc-writer/SKILL.md. Be certain to also take into account, related issues, pull requests, and comments that are directly linked as well as comments.</agent_instructions>

Comments on the Issue (you are Copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add missing documentation for App Model API features docs: Add App Model API documentation for CORS, console apps, resource naming, and networking Feb 20, 2026

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR looks good so far, but let's double check it for accuracy by using the .github/skills/doc-tester/SKILL.md skill. Please also consider all new comments and feedback. Copilot

Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor Author

This PR looks good so far, but let's double check it for accuracy by using the .github/skills/doc-tester/SKILL.md skill. Please also consider all new comments and feedback. Copilot

Ran the doc-tester validation on all new and updated pages. Here's what was verified:

All internal links return HTTP 200/diagnostics/aspire006/, /fundamentals/service-discovery/, /fundamentals/networking-overview/, /fundamentals/external-parameters/, /app-host/console-apps/, /app-host/cors-configuration/, /dashboard/configuration/, /dashboard/enable-browser-telemetry/, /fundamentals/service-defaults/, /app-host/executable-resources/.

Content accuracy checks:

  • KnownNetworkIdentifiers.LocalhostNetwork / .DefaultAspireContainerNetwork API signature verified against the what's-new/aspire-13.mdx reference
  • AddConnectionString usage verified against existing docs (external-parameters.mdx)
  • WaitFor, WithExplicitStart, AddRedisClient all verified as established APIs in existing docs
  • WithEnvironment(..., GetEndpoint(...)) pattern verified against resource-hierarchies.mdx

One structural fix made (commit e1a909e): An AddExecutable example was misplaced under the "For container resources" section in networking-overview.mdx — moved it to "For executable resources" where it belongs.

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:

  • https://api.github.com/repos/CommunityToolkit/Aspire
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/dotnet/aspire
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/dotnet/aspire-samples
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/microsoft/aspire.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/microsoft/dcp
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/.npm/_npx/aa98e6899c6baff3/node_modules/.bin/astro dev --port 4321 | cut -d&#34; &#34; -f2 (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js dev --port 4321 (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js build .0/bin/pnpm (dns block)

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

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR looks good so far, but let's double check it for accuracy by using the .github/skills/doc-tester/SKILL.md skill. Please also consider all new comments and feedback/suggestions. Copilot

Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx Outdated

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

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:

  • https://api.github.com/repos/CommunityToolkit/Aspire
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/dotnet/aspire
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/dotnet/aspire-samples
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/microsoft/aspire.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/microsoft/dcp
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./scripts/update-github-stats.js (http block)
  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js build (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js dev --port 4321 (dns block)

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds new AppHost documentation pages to close gaps around CORS, console/worker apps, and resource naming, and extends the networking fundamentals page with LAN binding and container-to-host guidance.

Changes:

  • Added new AppHost docs: CORS configuration, console/worker apps, and resource naming conventions.
  • Expanded networking-overview.mdx with LAN binding and container-to-host networking sections.
  • Updated the docs sidebar and refreshed the integrations catalog metadata.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/frontend/src/data/aspire-integrations.json Updates integration package versions/icons/download counts; adds new CommunityToolkit entries.
src/frontend/src/content/docs/fundamentals/networking-overview.mdx Adds LAN binding guidance and container-to-host networking + KnownNetworkIdentifiers examples.
src/frontend/src/content/docs/app-host/resource-naming.mdx New page describing env var mapping, dash→underscore behavior, and naming guidance.
src/frontend/src/content/docs/app-host/cors-configuration.mdx New page explaining when/how to configure CORS (dev/prod patterns + common issues).
src/frontend/src/content/docs/app-host/console-apps.mdx New page documenting console/worker app orchestration, service discovery, and dashboard logs.
src/frontend/config/sidebar/docs.topics.ts Adds new AppHost pages to the sidebar.

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

Comment thread src/frontend/src/content/docs/fundamentals/networking-overview.mdx Outdated
Comment thread src/frontend/src/content/docs/fundamentals/networking-overview.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/config/sidebar/docs.topics.ts Outdated
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/resource-naming.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/resource-naming.mdx Outdated

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR looks good so far, but let's double check it for accuracy by using the .github/skills/doc-tester/SKILL.md skill. Please also consider all new comments and feedback/suggestions. Copilot

Comment thread src/frontend/config/sidebar/docs.topics.ts Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

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: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js dev --port 4321 (dns block)

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

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #454. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #454 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

@mitchdenny

Copy link
Copy Markdown
Member

Still planning to merge?

Comment thread src/frontend/src/content/docs/app-host/resource-naming.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx Outdated
Comment thread src/frontend/src/content/docs/fundamentals/networking-overview.mdx Outdated
Comment thread src/frontend/src/content/docs/fundamentals/networking-overview.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/console-apps.mdx Outdated
Comment thread src/frontend/src/content/docs/app-host/cors-configuration.mdx
Comment thread src/frontend/src/content/docs/fundamentals/networking-overview.mdx Outdated

@aspire-repo-bot aspire-repo-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated wording suggestions from the forbidden-words check. Apply the suggestions to resolve them.

Comment thread src/frontend/scripts/aspire-terminology.ts
Comment thread src/frontend/scripts/aspire-terminology.ts
Comment thread src/frontend/scripts/aspire-terminology.ts
Comment thread src/frontend/scripts/aspire-terminology.ts
Comment thread src/frontend/scripts/aspire-terminology.ts
Comment thread src/frontend/scripts/aspire-terminology.ts
Comment thread src/frontend/tests/unit/update-samples.vitest.test.ts
Comment thread src/frontend/tests/unit/update-samples.vitest.test.ts
@IEvangelist David Pine (IEvangelist) added the ci:skip-forbidden-words Allows maintainers to bypass false positives in the forbidden-word check. label Aug 7, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@IEvangelist David Pine (IEvangelist) removed the ci:skip-forbidden-words Allows maintainers to bypass false positives in the forbidden-word check. label Aug 7, 2026
@IEvangelist
David Pine (IEvangelist) force-pushed the copilot/add-docs-for-app-model-api branch from ffdbece to 16278f4 Compare August 7, 2026 20:13
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.

[Discord Feedback] App Model API gaps - CORS, console apps, naming, networking

5 participants