Skip to content

[docs] Document ITokenCredentialProvider for reusing Aspire's Azure credential - #1527

Merged
David Pine (IEvangelist) merged 4 commits into
release/13.5from
docs/pr-17387-32124345757-1-64d9e6f251b4a4b6
Aug 18, 2026
Merged

[docs] Document ITokenCredentialProvider for reusing Aspire's Azure credential#1527
David Pine (IEvangelist) merged 4 commits into
release/13.5from
docs/pr-17387-32124345757-1-64d9e6f251b4a4b6

Conversation

@aspire-repo-bot

@aspire-repo-bot aspire-repo-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#17387

@eerhardt

Targeting release/13.5 — the latest release branch on microsoft/aspire.dev — because release/13.4 (from the source PR milestone 13.4) does not exist there.

Why

microsoft/aspire#17387 makes ITokenCredentialProvider public so integrations and AppHost code outside of Aspire.Hosting.Azure can resolve the same TokenCredential that Aspire's Azure hosting integrations use for provisioning and Azure API calls. This is a new public type (new_public_type signal) with an explicit "User-facing usage" section in the PR body (pr_body_has_user_facing_section signal), so it needs to be documented.

Changes

  • Updated src/frontend/src/content/docs/integrations/cloud/azure/azure-default-credential.mdx with a new "Reuse the credential in custom code" section that:
    • Shows how to resolve ITokenCredentialProvider from DI and use its TokenCredential property.
    • Notes the singleton registration via AddAzureProvisioning, including indirect registration through Azure resource extension methods that invoke it.
    • Explains that the concrete credential type is an implementation detail and should be treated as opaque.
    • Cross-references the existing "Default credential behavior" section.
    • Mentions that callers can replace the registration with a custom implementation.

No new pages were created; this is an addition to an existing, closely related page.

Generated by PR Documentation Check · auto · 36.6 AIC · ⌖ 6.34 AIC · ⊞ 19.6K ·

…edential

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 Aug 18, 2026

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

Copy link
Copy Markdown
Contributor Author

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.


## Reuse the credential in custom code

Integrations and app host code outside of `Aspire.Hosting.Azure`—for example, a pipeline step, lifecycle hook, or custom resource—can resolve the same `TokenCredential` that Aspire's Azure hosting integrations use for provisioning and Azure API calls. Resolve `ITokenCredentialProvider` from dependency injection and read its `TokenCredential` property:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Use "AppHost" instead of "app host".

Suggested change
Integrations and app host code outside of `Aspire.Hosting.Azure`—for example, a pipeline step, lifecycle hook, or custom resource—can resolve the same `TokenCredential` that Aspire's Azure hosting integrations use for provisioning and Azure API calls. Resolve `ITokenCredentialProvider` from dependency injection and read its `TokenCredential` property:
Integrations and AppHost code outside of `Aspire.Hosting.Azure`—for example, a pipeline step, lifecycle hook, or custom resource—can resolve the same `TokenCredential` that Aspire's Azure hosting integrations use for provisioning and Azure API calls. Resolve `ITokenCredentialProvider` from dependency injection and read its `TokenCredential` property:

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2fc23d00-db43-47fd-a3aa-290b772db576
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2fc23d00-db43-47fd-a3aa-290b772db576
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review August 18, 2026 10:41
Copilot AI lite review requested due to automatic review settings August 18, 2026 10:41

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 documentation for the newly public ITokenCredentialProvider so AppHost/custom integration code can reuse the same Azure TokenCredential that Aspire’s Azure hosting/provisioning uses.

Changes:

  • Adds a “Reuse the credential in custom code” section describing resolving ITokenCredentialProvider from DI and consuming its TokenCredential.
  • Documents how the provider is registered (via AddAzureProvisioning, including indirect registration via Azure resource extension methods).
  • Notes that consumers can replace the ITokenCredentialProvider registration with a custom implementation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@IEvangelist
David Pine (IEvangelist) marked this pull request as draft August 18, 2026 10:57
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2fc23d00-db43-47fd-a3aa-290b772db576
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

Frontend HTML artifact ready

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

VS Code: Open PR #1527 artifacts

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

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/frontend/src/content/docs/integrations/cloud/azure/azure-default-credential.mdx:79

  • PR description says this new section notes that the ITokenCredentialProvider singleton registration via AddAzureProvisioning is also reached indirectly via AddAzureEnvironment, but the doc only mentions Azure resource extension methods. Either update the PR description to match the actual doc change, or (if intended and accurate) update this paragraph to also mention AddAzureEnvironment.
`ITokenCredentialProvider` is registered as a singleton by `AddAzureProvisioning`. Azure resource extension methods invoke `AddAzureProvisioning`, so using those methods registers the provider indirectly. The credential it exposes is configured by the same Azure provisioning options (tenant ID, credential source, and so on) and matched to the current run or publish execution context, as described in [Default credential behavior](#default-credential-behavior).

@IEvangelist
David Pine (IEvangelist) merged commit 503a344 into release/13.5 Aug 18, 2026
11 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the docs/pr-17387-32124345757-1-64d9e6f251b4a4b6 branch August 18, 2026 14:00
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.

2 participants