Skip to content

Docs: replace non-Azure AsExisting examples with AddConnectionString#1076

Open
IEvangelist wants to merge 4 commits into
mainfrom
ievangelist/dapine-audit-asexisting-docs
Open

Docs: replace non-Azure AsExisting examples with AddConnectionString#1076
IEvangelist wants to merge 4 commits into
mainfrom
ievangelist/dapine-audit-asexisting-docs

Conversation

@IEvangelist
Copy link
Copy Markdown
Member

@IEvangelist IEvangelist commented May 26, 2026

Summary

This PR fixes the docs guidance behind #1074 by removing non-Azure AsExisting(...) examples that don't match available APIs.

The updated guidance now models existing external resources with AddConnectionString(...) / addConnectionString(...) instead.

What changed

  • Replaced non-Azure existing-instance snippets that used AsExisting(connectionStringParameter: ...).
  • Added C# and TypeScript examples using AddConnectionString / addConnectionString.
  • Clarified that these values are resolved from AppHost configuration keys such as ConnectionStrings:<name> / ConnectionStrings__<name>.
  • Clarified that this connection-string pattern does not inject typed resource-specific connection-property variables.

Files updated

  • src/frontend/src/content/docs/integrations/caching/redis/redis-host.mdx
  • src/frontend/src/content/docs/integrations/caching/garnet/garnet-host.mdx
  • src/frontend/src/content/docs/integrations/caching/valkey/valkey-host.mdx
  • src/frontend/src/content/docs/integrations/messaging/rabbitmq/rabbitmq-host.mdx
  • src/frontend/src/content/docs/integrations/databases/elasticsearch/elasticsearch-host.mdx
  • src/frontend/src/content/docs/get-started/glossary.mdx

Fixes #1074

Switch non-Azure existing-instance docs from AsExisting guidance to AddConnectionString modeling in Redis, Garnet, Valkey, RabbitMQ, Elasticsearch, and glossary patterns.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 26, 2026 19:04
@IEvangelist IEvangelist requested a review from eerhardt as a code owner May 26, 2026 19:04
Copy link
Copy Markdown
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

Updates Aspire integration docs to stop recommending non-existent/non-exposed AsExisting(...) patterns for non-Azure resources, replacing them with connection-string based modeling to address issue #1074.

Changes:

  • Replace C# AddX(...).AsExisting(...) examples with AddConnectionString(...) across several integration Host docs.
  • Replace TypeScript explanatory text with concrete addConnectionString(...) + withReference(...) examples.
  • Update the glossary “Existing resource pattern” snippet to use AddConnectionString(...).

Reviewed changes

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

Show a summary per file
File Description
src/frontend/src/content/docs/integrations/caching/redis/redis-host.mdx Switch existing-Redis example to connection-string resource; adds TS code sample.
src/frontend/src/content/docs/integrations/caching/garnet/garnet-host.mdx Switch existing-Garnet example to connection-string resource; adds TS code sample.
src/frontend/src/content/docs/integrations/caching/valkey/valkey-host.mdx Switch existing-Valkey example to connection-string resource; adds TS code sample.
src/frontend/src/content/docs/integrations/messaging/rabbitmq/rabbitmq-host.mdx Switch existing-RabbitMQ example to connection-string resource; adds TS code sample.
src/frontend/src/content/docs/integrations/databases/elasticsearch/elasticsearch-host.mdx Switch existing-Elasticsearch example to connection-string resource; adds TS code sample.
src/frontend/src/content/docs/get-started/glossary.mdx Update “Existing resource pattern” snippet to use AddConnectionString(...).

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

Comment thread src/frontend/src/content/docs/get-started/glossary.mdx
Add explicit notes that AddConnectionString/addConnectionString resolve from ConnectionStrings configuration and inject connection-string values, not typed resource connection-property variables.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist
Copy link
Copy Markdown
Member Author

Addressed the Copilot review feedback in b51f231:

  • Added clarification in each updated integration page that AddConnectionString / addConnectionString resolves values from ConnectionStrings:<name> (or ConnectionStrings__<name>) in AppHost configuration.
  • Clarified that this pattern injects a connection string value rather than typed resource-specific connection-property variables.
  • Added the same configuration-source note to the glossary AddConnectionString("db") example.

@IEvangelist IEvangelist enabled auto-merge (squash) May 26, 2026 20:31
@mitchdenny
Copy link
Copy Markdown
Member

I'm wondering whether it might be a more meaningful story if we show using AddGarnet locally and switching to AddConnectionString for deployment? The thing we need to figure out there is the differences in how the strings are handled because we won't deconstruct a connection string into REDIS_HOST and the like.

Call out that ConnectionStrings__{name} is passed through as a single connection string value and is not deconstructed into resource connection-property variables.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist
Copy link
Copy Markdown
Member Author

Follow-up update in bfca595:

I strengthened the wording in each affected section to explicitly call out format behavior:

  • ConnectionStrings__{name} / ConnectionStrings:{name} is a single pass-through connection string value.
  • It is not deconstructed into resource connection-property variables.
  • Each page now includes concrete examples of the resource-specific variables that are not emitted in this pattern.

Document when resource connection properties are available and when AddConnectionString/addConnectionString provides only a single ConnectionStrings value that is not deconstructed.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist
Copy link
Copy Markdown
Member Author

Expanded scope in 02ec0e7 to the corresponding *-connect pages (Redis, Garnet, Valkey, RabbitMQ, Elasticsearch).

Each now explicitly documents the distinction:

  • connection-property env vars are available when the AppHost models a typed resource.
  • AddConnectionString / addConnectionString provides a single ConnectionStrings value (ConnectionStrings:{name} / ConnectionStrings__{name}), and it is not deconstructed into per-property variables.

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.

Redis: Add an existing Redis instance Not Found Method AsExisting

3 participants