Skip to content

[docs] Obsolete PublishAsConnectionString migration guidance#1237

Draft
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.5from
docs/obsolete-publish-as-connection-string-263280fd9a435d00
Draft

[docs] Obsolete PublishAsConnectionString migration guidance#1237
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.5from
docs/obsolete-publish-as-connection-string-263280fd9a435d00

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#18044 — authored by @davidfowl.

Targeting release/13.5 based on the source PR milestone 13.5.

Why this PR is needed

PublishAsConnectionString (in both Aspire.Hosting and Aspire.Hosting.Azure) has been marked [Obsolete] in .NET Aspire 9.5 (microsoft/aspire#18044). The API only changes the manifest representation and does not affect other publishers, which misled callers. Existing users who call it will now receive a CS0618 compiler warning directing them to use AddConnectionString with execution context instead.

The docs previously contained code examples that called this API and a table entry listing it without any deprecation notice. Without documentation updates, users will see compiler warnings referencing an undocumented migration path.

Why docs are needed

Three signals fired from the source PR:

  • obsolete_attribute_added: [Obsolete] added to PublishAsConnectionString in AzureResourceExtensions.cs and ParameterResourceBuilderExtensions.cs
  • pr_body_has_deprecation_marker: PR body explicitly states the extension methods are being made obsolete
  • pr_label_breaking_change: PR carries the breaking-change label

Changes made

Updated: src/frontend/src/content/docs/fundamentals/external-parameters.mdx

  • Parameter example section: Replaced the .PublishAsConnectionString() call in the C# and TypeScript code examples with the preferred execution-context-based pattern using IsRunMode / executionContext.isRunMode. The run-mode branch adds the actual SQL Server resource; the publish-mode branch uses AddConnectionString.
  • Updated the accompanying numbered steps to reflect the new pattern.

Updated: src/frontend/src/content/docs/integrations/cloud/azure/overview.mdx

  • Marked the PublishAsConnectionString row in the API naming-conventions table as (obsolete) and updated its description to point to AddConnectionString.
  • Added a :::caution callout block below the table explaining the deprecation and showing the correct ExecutionContext.IsPublishMode migration pattern.

Updated: src/frontend/src/content/docs/ja/fundamentals/external-parameters.mdx

  • Applied the same C# example update to the Japanese localized version (removed .PublishAsConnectionString(), used execution-context pattern).
  • Updated the Japanese steps list to match.

Files modified

  • src/frontend/src/content/docs/fundamentals/external-parameters.mdx (updated)
  • src/frontend/src/content/docs/integrations/cloud/azure/overview.mdx (updated)
  • src/frontend/src/content/docs/ja/fundamentals/external-parameters.mdx (updated)

Generated by PR Documentation Check for issue #18044 · sonnet46 4M ·

… use AddConnectionString

- Update 'Parameter example' in external-parameters.mdx to use
  execution-context-based pattern (IsRunMode) instead of the now-obsolete
  PublishAsConnectionString() API
- Update the Japanese localized version of external-parameters.mdx to match
- Mark PublishAsConnectionString as obsolete in the azure/overview.mdx API
  table and add a migration caution callout showing the AddConnectionString
  pattern with execution context

Relates to microsoft/aspire#18044

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label Jun 9, 2026
@aspire-repo-bot aspire-repo-bot Bot requested a review from JamesNK June 9, 2026 07:59
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

Frontend HTML artifact ready

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

VS Code: Open PR #1237 artifacts

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants