Repository navigation
Docs: replace non-Azure AsExisting examples with AddConnectionString - #1076
Conversation
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 <[email protected]>
There was a problem hiding this comment.
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 withAddConnectionString(...)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.
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 <[email protected]>
|
Addressed the Copilot review feedback in b51f231:
|
|
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 <[email protected]>
|
Follow-up update in bfca595: I strengthened the wording in each affected section to explicitly call out format behavior:
|
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 <[email protected]>
|
Expanded scope in 02ec0e7 to the corresponding Each now explicitly documents the distinction:
|
…le formats Adds explicit documentation to connection pages (Redis, RabbitMQ, Garnet, Valkey, Elasticsearch) explaining the critical difference in how Aspire exposes connection information: - WithReference (typed resources): Individual [RESOURCE]_[PROPERTY] environment variables (e.g., CACHE_HOST, CACHE_PORT, CACHE_PASSWORD, CACHE_URI) - AddConnectionString (external strings): Single ConnectionStrings__name value only This clarifies that connection properties are NOT available when using AddConnectionString for external resources, and consuming apps must parse the connection string themselves. Addresses feedback that these format differences were not being called out clearly.
|
Environment Variable Documentation Added I have pushed an additional commit that clarifies the critical difference in how Aspire exposes connection information when using different patterns. This addresses the feedback about distinguishing between connection property formats. Key distinction documented: Using WithReference (typed resources):
Using AddConnectionString (external connection strings):
Updated pages:
Each now includes an explicit "Environment variables and connection string formats" section that explains both patterns and when each is available. |
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
AsExisting(connectionStringParameter: ...).AddConnectionString/addConnectionString.ConnectionStrings:<name>/ConnectionStrings__<name>.Files updated
src/frontend/src/content/docs/integrations/caching/redis/redis-host.mdxsrc/frontend/src/content/docs/integrations/caching/garnet/garnet-host.mdxsrc/frontend/src/content/docs/integrations/caching/valkey/valkey-host.mdxsrc/frontend/src/content/docs/integrations/messaging/rabbitmq/rabbitmq-host.mdxsrc/frontend/src/content/docs/integrations/databases/elasticsearch/elasticsearch-host.mdxsrc/frontend/src/content/docs/get-started/glossary.mdxFixes #1074