Repository navigation
Document the Microsoft Entra ID integration for Aspire 17.0 - #2086
Conversation
Add a multi-page Microsoft Entra ID integration section under integrations/security/microsoft-entra-id covering the hosting package, redirect URIs and sign-in, client credentials, exposing and calling APIs, application roles, existing registrations, infrastructure customization, lifecycle and permissions, and a web-to-API walkthrough. Consolidates and supersedes the independent draft PRs #1928, #1934, #1944, #1964, #1973, #1991, #2027, #2028, #2031, and #2043. Every claim was verified against microsoft/aspire. Also adds the sidebar group, an Entra row in the Azure provisioning package table, and cross-links from related Azure pages. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved documentation errors can break authentication and consent flows, block frontend startup, prevent preview-package restoration, and mislead readers about certificate rollover requirements.
5 open issues
Align TypeScript API client variables with AzureAd settings · New Qualify x5c rollover requirements for trusted issuer policies · New Use a prerelease-aware NuGet version for C# package references · New Map the health endpoint required by AppHost probes · New Request API scopes during sign-in or handle consent challenges · New
What changed in this PR
Adds a consolidated Microsoft Entra ID integration guide for Aspire 17.0, replacing overlapping draft documentation and connecting it to existing Azure guidance.
Changes:
- Adds nine pages covering registration setup, authentication, credentials, API permissions, roles, and lifecycle management.
- Provides TypeScript and C# AppHost examples with preview limitations and deployment requirements.
- Adds sidebar navigation, a provisioning-package entry, and related Azure cross-links.
| File | Description |
|---|---|
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/secure-web-and-api.mdx |
Adds a local-to-Azure authentication walkthrough. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/redirect-uris-and-sign-in.mdx |
Covers callbacks, audiences, and sovereign clouds. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/lifecycle-and-permissions.mdx |
Explains permissions, cleanup, and troubleshooting. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/index.mdx |
Introduces installation, configuration, and preview status. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/expose-and-call-apis.mdx |
Documents scopes, consent, and downstream API calls. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/existing-registrations.mdx |
Explains references to externally managed registrations. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/customize-infrastructure.mdx |
Demonstrates Microsoft Graph infrastructure customization. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/client-credentials.mdx |
Covers secrets, certificates, and identity federation. |
src/frontend/src/content/docs/integrations/security/microsoft-entra-id/app-roles.mdx |
Documents role declarations and managed identity assignments. |
src/frontend/src/content/docs/integrations/cloud/azure/user-assigned-identity.mdx |
Links to Entra application-role assignments. |
src/frontend/src/content/docs/integrations/cloud/azure/local-provisioning.mdx |
Links to the Entra integration overview. |
src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx |
Adds the Entra provisioning package and guidance. |
src/frontend/src/content/docs/integrations/cloud/azure/azure-key-vault/azure-key-vault-host.mdx |
Links to certificate credentials and automatic access grants. |
src/frontend/config/sidebar/integrations.topics.ts |
Adds the Microsoft Entra ID navigation group. |
Review effort: Balanced
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
Phase A: verified claim catalog (follow-up to the review)This lists every claim verified against Batch A1: index, redirect-uris-and-sign-in, lifecycle-and-permissionsI reviewed
All TypeScript methods and options in the three files are exported, and they match Path abbreviations used below:
index.mdx
redirect-uris-and-sign-in.mdx
lifecycle-and-permissions.mdx
Batch A2: client-credentials, app-roles, existing-registrations
All evidence comes from
File abbreviations: CC =
Batch A3: expose-and-call-apis, secure-web-and-api, customize-infrastructure, and the PR-added Azure page lines
Abbreviations used for evidence. All
|
Eric Erhardt (eerhardt)
left a comment
There was a problem hiding this comment.
Docs accuracy review: Microsoft Entra ID integration (doc-pr-reviewer)
Verdict: REQUEST_CHANGES (1 contradicted claim). It's posted as a
COMMENTreview because GitHub doesn't allow requesting changes on your own pull request.
Sources of truth (Phase A)
| Repo | Branch | SHA |
|---|---|---|
microsoft/aspire |
release/17.0 |
cec195f2d0bf3f1d714badf74f205fa855fdf963 |
AzureAD/microsoft-identity-web |
master |
d37ee59, only for the Microsoft.Identity.Web snippets |
- The Entra ID source directories on
release/17.0are identical tomain. CommunityToolkit/AspireandAzure/azure-sdk-for-netweren't needed, because no claim routes to them.
Claims (Phase A): 455 extracted.
| Verdict | Count |
|---|---|
| verified | 394 |
| verified-with-nuance | 20 |
| unverifiable | 4 |
| contradicted | 1 |
| narrative | 36 |
Doc-tester (Phase B): a blind new-user run against the local dev server at PR head 9bdd5c7, covering all 9 Entra ID routes and the sections this PR adds to 4 Azure pages. It found 0 critical issues and 17 warnings. Both testers' findings plus the reviewer's scan give 34 conciseness findings.
Bottom line
Accuracy is strong.
- Every TypeScript method and option in the TS tabs is exported, and no C#-only API appears in a TS tab.
- Links and anchors all resolve.
- The one contradiction is a sample bug.
Size and relevance are the main problems.
- The 9 pages total about 13,000 prose words. For comparison, the Keycloak page is about 1,500 and the Key Vault hosting page about 1,100.
- A meaningful share of that text describes how Aspire works internally: Bicep modules and declarations,
keyId, pipeline step names, deployment ordering, why workarounds exist, ID derivation. It doesn't tell a reader what to do. - The same facts also repeat across pages. The biggest one, "Aspire never modifies existing registrations", appears about 6 times.
The conciseness section below lists concrete cuts.
Phase A: Claim verification
Contradicted (1), with inline comment
- A3-21 ·
expose-and-call-apis.mdx:158. The C# sample under "Declare permissions and consent" usesapiService, but the page's C# tab never assigns it: line 48 isbuilder.AddDotnetProject("apiservice", ...)with no variable. This is CS0103. The TypeScript tab is correct.
Unverifiable (4), with inline comments
- A1-86 ·
redirect-uris-and-sign-in.mdx:242: "Sovereign-cloud provisioning and federation haven't been fully validated for the Aspire 17.0 preview." No source states this. It's product status that comes from epic microsoft/aspire#21060, not from code. - A1-146 ·
lifecycle-and-permissions.mdx:153: same claim as A1-86, repeated. - A1-147 ·
lifecycle-and-permissions.mdx:154: the roadmap non-features (External ID, CLI and template onboarding, registration picker, OIDC emulator). There's no source evidence, and the source is partly in tension with it:WithInstancedocumentshttps://contoso.ciamlogin.com/for external tenants (EntraIdResourceExtensions.cs:1297). - A2-146 ·
app-roles.mdx:67: "UseUserfor users and groups andApplicationfor applications and managed identities." The source only says the value is passed through to Graph and defaults toUser(EntraIdAppRole.cs:29). The mapping is Graph semantics, so link it to Graph'sappRoledocs.
Verified with nuance (20)
| ID | Location | Nuance | Suggested fix |
|---|---|---|---|
| A1-16 | index:96 | The portal link only appears for known clouds (EntraIdUrls.cs:35-40, 60-61). |
"…and, for public and national clouds, to the app registration in the portal." |
| A1-40 | index:164 | The DownstreamApis prefix ignores the connection name only for .NET. Other resources nest it under the connection prefix (EntraIdResourceExtensions.cs:3110-3111). |
State both cases. |
| A1-60 | redirect:65 | The doc is right: the allocated origin is still used (EndpointReference.cs:423-431). The XML doc at EntraIdResourceExtensions.cs:1494 is stale and says the opposite. |
Keep the doc text (or cut it as detail). File an upstream XML-doc fix. |
| A1-97 | lifecycle:24 | The automatic Key Vault Certificate User role applies only to the vault-resource overload. The URL overload grants nothing. | "When WithCertificateFromKeyVault references a Key Vault resource in the AppHost…" |
| A1-129 | lifecycle:127 | Missing IDs show as ?, not "unknown" (AzureProvisioningController.cs:805,1876). |
Fix it or cut it (see conciseness). |
| A1-149 | lifecycle:160-162 | The error codes and messages match the e2e helpers. The HTTP status numbers (403/404/400) appear nowhere in the source. | Drop the HTTP numbers. |
| A2-47 | client-credentials:266 | It implies tokenExchangeUrl/tokenExchangeAuthority are TypeScript-only. C# can set them on EntraIdFederatedIdentityCredential through WithCredential (EntraIdApplicationResource.cs:1190,1198). |
Mention the C# path. |
| A2-57 | client-credentials:314 | WithRoleAssignments replacing the automatic role applies only when publishing. Locally, roles come from the vault defaults (EntraIdResourceExtensions.cs:1259-1288). |
"When you publish, … Locally, use ClearDefaultRoleAssignments on the vault." |
| A2-89 | app-roles:94 | You can remove the last role from the AppHost. Aspire just stops sending appRoles, so the role stays on the registration (README:756). It also duplicates app-roles:234. |
"Removing the last declared role doesn't delete it from the registration…" Keep one copy. |
| A2-91 | app-roles:100 | Role names are validated when PublishWithAppRoleAssignment is called, which requires WithAppRole first. "When you write the AppHost" is vague. |
"Declare the role with WithAppRole before calling PublishWithAppRoleAssignment." |
| A2-101 | app-roles:183-216 | Worker.cs and Program.cs fragments are missing usings (Azure.Core, Azure.Identity, Microsoft.Identity.Web, JwtBearer), and cancellationToken is undefined. |
Add the usings or label them as fragments. |
| A3-34 | expose:191 | The snake-case rule depends on the resource type (not a .NET program), not on the language (EntraIdResourceExtensions.cs:3002,3048). |
"Resources that aren't .NET programs…" |
| A3-37 | expose:198-210 | In the page flow, webFrontend already references entraWeb. This second reference duplicates AzureAd__* and emits DownstreamApis under two prefixes (:3097). |
Say "instead of withReference(entraWeb)" / "pass downstreamApisPrefix in the existing call". |
| A3-40 | expose:228 | AddDownstreamApis ships in the separate Microsoft.Identity.Web.DownstreamApi package. |
Name the package. |
| A3-47 | expose:266-304 | entraWeb is redeclared (JS SyntaxError / CS0128 if combined with the earlier samples). using Aspire.Hosting.Azure; sits mid-file. web and webfrontend both add ../Web/Web.csproj. |
Use distinct names, or present the snippets as standalone. |
| A3-50 | expose:317-347 | Inline comment. The sovereign-cloud Graph sample calls entraWeb.withExternalApiPermissions(...) on the same registration that already declared EntraIdWellKnownApi.MicrosoftGraph. Access is matched by application ID only (EntraIdApiAccess.cs:45, EntraIdResourceExtensions.cs:2659), so the US Government resourceUri/baseUrl are silently ignored and the entry keeps graph.microsoft.com. |
Use a different registration, and say "use a custom Graph definition instead of EntraIdApi.MicrosoftGraph, not alongside it." |
| A3-56 | expose:381,387 | The parameterless WithApplicationIdUri() resets a custom URI back to the default (:2303-2304). |
"keep a WithApplicationIdUri call (with your custom URI, if you use one)". |
| A3-81 | secure-web-and-api:158,186 | With no initial scopes, consent happens only if the app turns the token-acquisition failure into a challenge. MicrosoftIdentityMessageHandler doesn't do that for consent. |
Pass the scope to EnableTokenAcquisitionToCallDownstreamApi in the sample, or mention [AuthorizeForScopes]. |
| A3-100 | customize-infrastructure:35,40 | Awaiting bicep() and parameter() is harmless but differs from the fixture and the package README. |
Optional: match the fixture. |
| A3-120 | azure-key-vault-host (added line) | The automatic role applies only when you pass the vault resource, and explicit consumer role assignments replace it. | "When you pass the vault resource, … unless you configure their roles explicitly." |
The full verified catalog (394 claims with repo path:line evidence) is in this comment, because it doesn't fit in one review body.
FYI, outside this PR's changed lines: the pre-existing Key Vault page text says AddAzureKeyVault defaults to Key Vault Administrator. The code defaults to Key Vault Secrets User (AzureKeyVaultResourceExtensions.cs:147-148; the XML doc at :32 is also stale). The Phase B tester noticed the two pages disagree. The Entra page is the correct one.
Version placeholders: no hard-coded Aspire versions, so no %ASPIRE_VERSION% changes are needed. Six release-scoped "17.0" mentions will age: index:17, redirect:242, lifecycle:153, 154, 164 and 168. Consider "this preview".
Conciseness and relevance
This is the reviewer's synthesis of Phase A (source readers), Phase B (blind testers), and a direct scan. The guiding rule: keep only what someone using the feature needs to know or do. It's ordered roughly by payoff.
1. Delete or collapse implementation-detail passages
| Page:line | Passage (abridged) | Action |
|---|---|---|
| customize-infrastructure:109-113 | "Know how the module is generated": the pinned br:mcr.microsoft.com/...:1.0.0 reference, temp or published output copies, module outputs |
Delete the section. Keep one line elsewhere: "The first deployment downloads the Microsoft Graph Bicep extension from mcr.microsoft.com, which must be reachable." (index:26 already says this.) |
| customize-infrastructure:96-105 | "declares the application a second time, because the client ID is known only after…" plus the list of 6 proxy types | Shorten to "Select the application by the identifier application; a registration with the default api://{clientId} URI has more than one MicrosoftGraphApplication." Drop the proxy list. |
| customize-infrastructure:9 | "Aspire generates a Bicep module… uses the Microsoft Graph Bicep extension to declare…" | Shorten to "Use ConfigureInfrastructure to set properties Aspire doesn't model, such as tags and the service management reference." |
| client-credentials:104-122 | The three local-certificate subsections: lifetime, store path, env vars, keyCredentials ownership, "Graph assigns the certificate credential ID. Aspire doesn't set keyId…", "A failed Microsoft Graph update leaves the new PFX…" |
Collapse to about 4 bullets: valid 48 h and renewed at startup when ≤24 h remain (restart long sessions); stored at dev-certs/Entra/<name>.pfx in the AppHost store (delete it to reset); each run replaces all certificate credentials on the registration, so don't add your own; development registrations only. |
| client-credentials:69 | "Aspire never provisions a private key into Entra." | Delete (repeats the previous sentence). |
| client-credentials:177-183 | "adds a Microsoft.Graph/applications/federatedIdentityCredentials resource to the generated Bicep with these values…" and "Deployment order is identity, then registration, then workload." |
Shorten to "Aspire adds a federated credential that trusts each workload's managed identity (Azure public, US Government, and China clouds)." Keep the issuer, subject, and audience values only under "Use a managed identity trust that you created", where users type them. |
| client-credentials:235 | "A validation step runs after the azure-prepare-resources pipeline step…" |
Shorten to "Publishing fails with an error naming the workload if…" |
| client-credentials:237, 268, 303 | "…doesn't make the registration depend on the web app", "doesn't enable mTLS proof-of-possession", "The vault URI remains a deferred resource reference…" | Delete. |
| expose-and-call-apis:75 | "…so Aspire sets the default api://{clientId} URI in a second update of the registration in the same deployment." |
Shorten to "Without a custom URI, Aspire uses api://{clientId}." |
| expose-and-call-apis:94 | "Aspire always sets requestedAccessTokenVersion to 2, which exempts the URI…" |
Shorten to "A strict tenant identifier-URI policy can reject custom URIs; see …" |
| expose-and-call-apis:121 | "Scope IDs derive from the registration and scope names…" | Shorten to "Scope IDs stay the same across deployments. Set id to adopt an existing scope." |
| expose-and-call-apis:257 | "Each registration deploys as its own module. Pre-authorization makes the API's module wait for…" | Shorten to "A pair of registrations can use a declaration or pre-authorization, not both." |
| expose-and-call-apis:383-389 | "What a deployment sends": "Aspire sends … in full, even when a list is empty. Graph replaces each list." | Rewrite as the effect: "Portal edits to scopes, URIs, or pre-authorized clients are overwritten on the next deployment. Once nothing declares the API, Aspire leaves them in place." |
| expose-and-call-apis:190 | The full {name} derivation rules for DownstreamApis |
Shorten to one concrete key example (DownstreamApis:apiservice:Scopes:0) plus one sentence. |
| app-roles:68, 73, 81, 85, 222 | "derives a stable ID from…", "sends the complete appRoles collection, and Microsoft Graph replaces what's stored", "assigns the role to the identity's principal (object) ID, not to its client ID" |
Shorten to the effect ("each deployment replaces the registration's roles with what the AppHost declares"). Delete the principal-ID sentence. |
| existing-registrations:108, 129, 131, 189 | "enables Azure provisioning before AsExistingApplication runs, and the fluent API doesn't undo that setup", "Aspire checks this before it changes the resource…", "isn't part of the publish manifest, so deployment generates no Bicep", "because a guessed URI would fail later as a token error" |
Delete or shorten. For 108: "AsExistingApplication keeps the Azure setup, so deployment can still require Azure authentication." |
| redirect-uris-and-sign-in:61-65, 122 | "whether you configure them before or after…", "The registration depends on the compute environment, not on the web app", the 30-second/removed-URL edge cases, "The generated Bicep splits parameter values on commas" | Delete the ordering and edge-case sentences. Change 122 to "Separate URIs with commas and no spaces." |
| redirect-uris-and-sign-in › Keep browser origins consistent | A general endpoint API (PrimaryBrowserOrigin/BrowserOrigins), not Entra-specific |
Cut to one sentence with a link, or move it to the endpoints docs. |
| lifecycle-and-permissions:13, 41, 127 | "with the Microsoft Graph Bicep extension…", "Aspire sends it in full, and Microsoft Graph replaces what's stored", "offers deployment reprovisioning, cancellation, and local-state commands… doesn't query Microsoft Graph…" | Shorten to the effects. For cleanup: "Delete Azure resources doesn't delete registrations; it lists them with object IDs so you can delete them yourself." |
| lifecycle-and-permissions:156-164 | "Deploy again after transient Graph failures": the module mechanics, HTTP codes, "tracked as an upstream … issue" | Fold into the troubleshooting row: "Known transient Graph error right after creation; deploy again. If it persists, treat it as a real permissions issue." |
| lifecycle-and-permissions:153-154, 166-168 | Roadmap non-features, a duplicate sovereign caution, and a "Preview status" section that duplicates index:16-18 | Delete. |
| index:34, 103-160 | The Python generator naming aside (add_entra_id_app), the five-bullet dashboard-state list, and the five connection-name normalization rules |
Shorten: keep the per-language-naming sentence, two state bullets with a link to troubleshooting, and one connection-name example plus one rule. |
2. Give each repeated fact one home and link to it
- "Aspire never modifies existing registrations" (about 6 times: redirect, client-credentials ×2, app-roles ×2, expose ×2, lifecycle) → keep it on Existing registrations only.
- Consent and app-role-assignment privileges (expose › Required privileges, app-roles › Grant the deployer, lifecycle table) → keep the lifecycle permissions table and link to it.
- "Use separate dev and prod registrations" (secure-web-and-api, client-credentials, lifecycle) → keep it once, under the local developer certificate.
- "Registrations survive resource-group deletion" (secure-web-and-api, client-credentials, lifecycle) → keep it in lifecycle › Clean up.
- Federated credential issuer, subject, and audience (client-credentials ×2, secure-web-and-api, existing-registrations) → keep it once, under "Use a managed identity trust that you created".
[RequiredScope]and message-handler code (expose-and-call-apis and secure-web-and-api) → keep it in the walkthrough and link from the other page.- "Existing API registrations" section in expose-and-call-apis → replace it with a link to existing-registrations › Describe an existing API.
- App-roles limitations are stated twice on the same page (intro, Retire a role, Limitations) → keep them in one section.
3. Small clarity fixes that support the cuts (from Phase B)
- "When you write the AppHost" is vague (expose and app-roles). Say "when the call runs" instead.
- "consumers" is overloaded: it's a
TenantIdvalue and also means "apps that reference the registration". Use "referencing apps". - The TypeScript and C# samples diverge in places:
redirectHostvshost.- The app-roles TypeScript tab uses containers with no identity, while the C# tab uses projects plus a user-assigned managed identity.
- The C# service principal lookup uses
.Single(), while the prose says "look up by identifier".
- Move the experimental
ASPIREAZUREPROVISIONING001aside into the TypeScript tab on customize-infrastructure, because C# doesn't need that package.
Phase B: Doc-tester results
The following are the two blind-tester reports, verbatim. Neither tester read microsoft/aspire or any other source. They used only the rendered local site at http://localhost:4322/ (PR head 9bdd5c7) through playwright-cli, in sessions entra-b1 and entra-b2.
Tester 1: overview, secure-web-and-api, redirect URIs and sign-in, client credentials, lifecycle and permissions
Documentation test report
Focus area: PR #2086, the Microsoft Entra ID integration docs (5 routes)
Date: 2026-11-10
Tester: doc-tester agent (testing as a new user who can only see the rendered site)
Site: http://localhost:4322/ (PR head 9bdd5c7)
Routes tested: /integrations/security/microsoft-entra-id/, .../secure-web-and-api/, .../redirect-uris-and-sign-in/, .../client-credentials/, .../lifecycle-and-permissions/
playwright-cli session: -s=entra-b1 (now closed)
Summary
| Category | Passed | Failed | Warnings |
|---|---|---|---|
| Content accuracy | 5 | 0 | 5 |
| Code examples | 5 | 0 | 4 |
| CLI commands | 1 | 0 | 0 |
| Links | 5 | 0 | 0 |
| Conciseness / relevance | 0 | — | 14 |
Critical issues
None. Every page loaded, every internal link and anchor resolved, and every TypeScript/C# code group has both languages.
Warnings
Warning 1: Undefined variables in some snippets
Location: /client-credentials/, "Certificate from Azure Key Vault"
Issue: addExistingEntraApplication("entra-web", tenantId, webClientId) uses tenantId and webClientId. These are only defined in the earlier "Client secret" snippet, so someone jumping to this section can't run it.
Same pattern elsewhere: entraWeb, web and builder on /redirect-uris-and-sign-in/ from "Use a host parameter" onward.
Suggestion: Add the parameter lines, or a note such as "continues from Client secret".
Warning 2: TypeScript and C# samples don't match each other
Location: /redirect-uris-and-sign-in/, "Use a host parameter"
Issue: The same parameter is called redirectHost in TypeScript and host in C#.
Location: overview, "Add a registration and reference it"
Issue:
- TypeScript calls
.withRedirectUris(...)twice with one URI each. - C# passes both URIs in a single call.
- The reason (TypeScript takes one value per call) is only explained on a different page: "In TypeScript, call withRedirectUris repeatedly to add more than one value."
Suggestion: Use the same names in both languages, and add a one-line note at the first place the TypeScript pattern appears.
Warning 3: TypeScript style changes from snippet to snippet
Issue: Two styles are mixed, sometimes on the same page:
- Chaining on a call you haven't awaited yet:
await builder.addDotnetProject(...).withReference(apiEntra).withHttpHealthCheck(...)(secure-web-and-api). - Awaiting first and then calling separately:
const web = await builder.addDotnetProject(...); await web.withExternalHttpEndpoints();(redirect-uris).
A new TypeScript user can't tell whether both forms are valid.
Warning 4: "consumers" means two different things
Location: /redirect-uris-and-sign-in/, "Choose a sign-in audience"
Issue: "consumers" is a TenantId value in the table ("PersonalMicrosoftAccount … consumers"). The next paragraph says "For existing registrations, it configures consumers only", meaning the apps that reference the registration. The same overloaded word appears in "Use WithInstance to point consumers at a sovereign cloud" and on /client-credentials/ ("files on the consumer", "the consumer's AZURE_FEDERATED_TOKEN_FILE setting").
Suggestion: Say "referencing workloads" or "apps that reference the registration".
Warning 5: The same thing has several names
Issue:
- The registration is called "registration", "app registration", "Entra ID application" and "Entra ID resource" (client-credentials: "for each Entra ID resource").
- The method names
AddEntraIdApplicationandAddExistingEntraApplicationdiffer: one has "Id" and one doesn't. I couldn't tell whether this is a docs typo or the real API. - The suffix appears as "Tenant-scoped resource suffix" (secure-web-and-api, with no explanation or link),
Azure:TenantResourceSuffix(client-credentials aside) andtenantResourceSuffix(lifecycle). Only the lifecycle page explains it.
Suggestion: Pick one noun for the registration. Link the first mention of the suffix to /lifecycle-and-permissions/#separate-registrations-with-a-tenant-scoped-suffix.
Warning 6: Prose uses C# method names while TypeScript is the default tab
Location: all pages
Issue: TypeScript is the default tab, but the prose says WithScope, RunWithLocalDeveloperCertificateCredential, WithRedirectUris and so on. The overview explains the naming convention once; other pages don't.
Warning 7: The secure-web-and-api walkthrough doesn't list the app's packages or usings
Location: /secure-web-and-api/, "Protect the API" and "Sign in users and call the API"
Issue:
Program.csusesJwtBearerDefaults,OpenIdConnectDefaults,AddMicrosoftIdentityWebApi,AddMicrosoftIdentityMessageHandler,[RequiredScope]andWeatherApiClient.- None of the NuGet packages or
usingdirectives these need are mentioned, andWeatherApiClientis never defined. - Step 4 of "Run the scenario locally" ("Use a page of the web app that calls the API") assumes a page the walkthrough never builds.
Warning 8: Configuration code differs between the API and web samples
Issue:
- API (secure-web-and-api):
AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd")) - Web (same page):
AddMicrosoftIdentityWebApp(builder.Configuration), with no section given. - Overview:
AddAuthentication()with no scheme.
A reader may wonder whether these differences matter.
Warning 9: Ambiguous table row in "Choose a credential"
Location: /client-credentials/, "Choose a credential" table
Issue: The row "WithCertificateFromFile, WithSignedAssertionFile in TypeScript, WithCredential in C#" is ambiguous; it isn't clear which names belong to which language.
Related: "In TypeScript, an options object also accepts tokenExchangeUrl and tokenExchangeAuthority". The page doesn't say how C# users do the same thing.
Passed checks
Sidebar
- "Security & identity › Microsoft Entra ID" renders, expanded, with 9 entries: Overview, Secure a web app and API, Redirect URIs and sign-in, Client credentials, Expose and call APIs, Application roles, Existing registrations, Customize infrastructure, Lifecycle and permissions.
aria-current="page"is set correctly, and all entries have trailing slashes.
Tabs
- Every code group has TypeScript first and selected by default: overview ×2, secure ×1, redirect ×7, client-credentials ×10, lifecycle ×2.
- Clicking C# in one group switched every group on the page (10 of 10 on client-credentials).
- The choice persisted after navigating (
starlight-synced-tabs__aspire-lang=C#). - The install tabs (Aspire CLI /
#:package/ PackageReference) render, showingaspire add azure-entraid.
Links
- All internal links are site-relative with trailing slashes, return 200, and every cross-page anchor exists, including:
#settings-that-the-caller-receives#declare-permissions-and-consent#troubleshoot-entra-id-errors#required-permissions#local-developer-certificate#call-microsoft-graph-and-other-first-party-apis#required-privileges-for-consent#grant-the-deployer-the-required-permissions#understand-how-deployments-update-roles#retire-scopes-and-understand-what-deployments-remove
- The only failed anchor checks were the
#tab-panel-NIDs, which are generated per render, so they are false positives.
Content
- Prerequisites on the overview clearly separate "create registrations" from "reference existing".
- The secure-web-and-api walkthrough has clear local and deploy steps.
- The troubleshooting table is actionable.
Console: No content errors. The only console errors are from the dev server (dev-toolbar 504, /api/live 404).
Recommendations
- Priority fixes:
- Make TypeScript and C# variable names match (W2).
- Define, or point back to, the variables that snippets borrow from earlier sections (W1).
- Stop using "consumers" to mean apps (W4).
- Make the registration name and the suffix naming consistent (W5).
- Documentation gaps: NuGet packages and usings for the app-side code in the walkthrough, and how C# sets token-exchange options for other clouds (W7, W9).
- Product issues: Check whether the
AddExistingEntraApplication/AddEntraIdApplicationnaming difference is intended (W5). - Conciseness: Cut the implementation-detail passages listed below. The client-credentials local-certificate subsections and the lifecycle "transient Graph failures" and "Clean up" sections are the heaviest.
Knowledge gaps
Knowledge gap: Packages for the app-side code
What I needed to know: Which NuGet packages provide AddMicrosoftIdentityWebApi, AddMicrosoftIdentityMessageHandler, [RequiredScope] and JwtBearerDefaults.
Source of my knowledge: Prior knowledge, not the docs.
User impact: Anyone new to Microsoft.Identity.Web.
Recommendation: Add a short "App packages" note to /secure-web-and-api/.
Knowledge gap: TypeScript chaining before await
What I needed to know: Whether await builder.addX(...).withY(...) is valid in the TypeScript AppHost.
Source of my knowledge: Assumed from other Aspire TypeScript samples.
Recommendation: Use one style consistently.
Knowledge gap: Delegated vs application permissions
What I needed to know: What "delegated access" and "application identity" mean in "Application.ReadWrite.All for delegated access … Application.ReadWrite.OwnedBy".
Source of my knowledge: Prior Entra knowledge.
User impact: Non-Entra developers.
Recommendation: Link to the Entra permission types documentation.
Knowledge gap: When using Aspire.Hosting.Azure; is needed
What I needed to know: Only the file-credential C# sample includes this using. EntraIdSignInAudience (redirect page) uses the same type family without it, so I couldn't tell when the using is required.
Conciseness / relevance findings
| # | Route › heading | Quoted passage | Why it doesn't help a user | Suggested change |
|---|---|---|---|---|
| 1 | overview › (preview aside) | "The opt-in Aspire.Hosting.Azure.Provisioning.EntraId package, which customizes the generated infrastructure from TypeScript and other polyglot AppHosts, is experimental and reports ASPIREAZUREPROVISIONING001." | An advanced package and diagnostic ID on the landing page. It is repeated verbatim in lifecycle › "Preview status". | Keep "preview; APIs may change". Move the package detail to customize-infrastructure only. Delete lifecycle › "Preview status". |
| 2 | overview › Hosting integration | "For example, Python's generator abbreviates Application to app, as in add_entra_id_app and with_app_owners." | Describes code-generator internals. | Cut, or keep only "Method names follow each language's conventions." |
| 3 | overview › Add a registration… | Five-bullet dashboard state list ("starts in the Waiting state until its tenant ID and client ID are known, then validates its settings…") | Long, and the Missing-subscription bullet is repeated on secure-web-and-api and in the lifecycle troubleshooting table. | Shorten to two bullets (what you see; where to look on failure) and link to troubleshooting. |
| 4 | overview › Change the environment variable names | The 5-bullet connection-name rules, e.g. "An empty connection name omits the prefix and its separator…", "ENTRA_CLIENT_CREDENTIALS_0_SOURCE_TYPE" | Edge-case normalization rules most readers won't need. | Keep the example and one rule. Collapse the rest into a details block. |
| 5 | redirect-uris › Derive redirect URIs… | "If URL customization takes longer than 30 seconds to finalize, Aspire logs a warning and uses the allocated origin. If customization removes every browser URL…" and "The registration depends on the compute environment, not on the web app." | Timeout internals and dependency-graph details; I couldn't act on them. | Cut, or reduce to "If the registered URI doesn't match what the browser shows, supply explicit URIs." |
| 6 | redirect-uris › Use literal or parameter URIs | "The generated Bicep splits parameter values on commas, so a URI can't contain a comma and entries can't have surrounding whitespace." | Explains the rule through how the Bicep is generated. | "Separate URIs with commas and no spaces." |
| 7 | redirect-uris › Keep browser origins consistent | Whole section (PrimaryBrowserOrigin, BrowserOrigins, CORS) |
General endpoint API, not Entra-specific; off-topic here. | Move to the networking/endpoints docs and link from one sentence. |
| 8 | client-credentials › Local developer certificate › Certificate lifetime / Where the certificate is stored / How the registration is updated | "self-signed RSA certificate that is valid for 48 hours… reuses the certificate when more than 24 hours remain"; "passwordless PFX file… dev-certs/Entra/.pfx… honors Aspire:Store:Path and ASPIRE__STORE__PATH"; "Aspire owns the registration's entire keyCredentials collection"; "Microsoft Graph assigns the certificate credential ID. Aspire doesn't set keyId, which avoids targeting an immutable credential when you redeploy."; "A failed Microsoft Graph update leaves the new PFX file available for a retry." | Mostly internals. Only three facts are actionable: restart within ~2 days, don't add your own certs to a dev registration, and where to delete the file. | Collapse the three subsections into about four bullets. |
| 9 | client-credentials › Local developer certificate | "Aspire never provisions a private key into Entra." | Repeats the previous sentence ("registers only its public key"). | Cut. |
| 10 | client-credentials › Create the trust… | "Aspire adds a Microsoft.Graph/applications/federatedIdentityCredentials resource to the generated Bicep with these values: issuer… subject… audience…" and "Deployment order is identity, then registration, then workload." | Generated-resource internals. The same issuer/subject/audience details also appear on secure-web-and-api › Deploy ("trusts the tenant's v2.0 issuer, uses the managed identity's principal ID as the subject…"). | Keep the values only under "Use a managed identity trust that you created", where the user must type them. Cut them from the other two places. |
| 11 | client-credentials › Trust specific workloads… | "A validation step runs after the azure-prepare-resources pipeline step and fails, naming the resource…" | Names an internal pipeline step. | "Publishing fails with an error naming the workload if…" |
| 12 | client-credentials › Use a managed identity trust… / Key Vault | "It also doesn't enable mTLS proof-of-possession."; "The vault URI remains a deferred resource reference. A local run resolves the vault output, or its emulator endpoint…" | Not something a user acts on. | Cut both. |
| 13 | lifecycle › Clean up registrations | "The registration offers deployment reprovisioning, cancellation, and local-state commands. It doesn't offer ARM resource inspection, relocation, or deletion… The report doesn't query Microsoft Graph to verify live objects, and it lists missing IDs as unknown." | Command internals. | "Delete Azure resources won't delete registrations; it lists them so you can delete them yourself." |
| 14 | lifecycle › Deploy again after transient Graph failures and Known limitations | "Each registration deploys as one Bicep module. The module creates the application and, seconds later, sends more Microsoft Graph requests…"; "tracked as an upstream Microsoft Graph Bicep issue" (no link); "CLI and template onboarding, an existing-registration picker, and a local OpenID Connect emulator aren't part of 17.0." | Explains the mechanism and roadmap; the three error codes are already in the troubleshooting table. | Merge into the troubleshooting row ("Deploy again; this is a known transient Graph issue"). Drop the roadmap list. |
Repeated across pages (pick one home for each):
- "Existing registrations are never modified / throw InvalidOperationException": redirect intro, ID-token section, client-credentials (×2), lifecycle intro and Known limitations.
- "Aspire never creates, stores, or rotates client secrets or certificates": client-credentials intro and lifecycle limitations.
- "Use separate dev/prod registrations": secure-web-and-api, client-credentials aside, lifecycle.
- Key Vault Certificate User role: client-credentials and lifecycle.
Application.ReadWrite.All/OwnedBy: client-credentials › How the registration is updated and the lifecycle permissions table.- "Registrations remain after deleting the resource group": secure-web-and-api, client-credentials limitations, lifecycle.
- Owners: "Owners are appended… never removes" and the "Owners — Stay" table row, both on lifecycle.
Tester 2: expose and call APIs, application roles, existing registrations, customize infrastructure, PR-added Azure page sections
Documentation test report
Focus area: PR #2086, Microsoft Entra ID docs: Expose and call APIs, Application roles, Existing registrations, Customize infrastructure, and the PR-added parts of four Azure pages
Date: 2026-11-10
Tester: doc-tester agent (blind new user, rendered site only)
Site: http://localhost:4322/ (PR head 9bdd5c7)
playwright-cli session: -s=entra-b2 (closed when done; scratch files deleted)
Routes exercised:
/integrations/security/microsoft-entra-id/expose-and-call-apis//integrations/security/microsoft-entra-id/app-roles//integrations/security/microsoft-entra-id/existing-registrations//integrations/security/microsoft-entra-id/customize-infrastructure//integrations/cloud/azure/customize-resources//integrations/cloud/azure/local-provisioning//integrations/cloud/azure/user-assigned-identity//integrations/cloud/azure/azure-key-vault/azure-key-vault-host/- Link targets only:
/client-credentials/#certificate-from-azure-key-vault,/microsoft-entra-id/, and/lifecycle-and-permissions/(to check for repeated content)
Summary
| Category | Passed | Failed | Warnings |
|---|---|---|---|
| Content accuracy | 8 | 0 | 5 |
| Code examples | 14 tab sets | 0 | 6 |
| CLI commands | 1 (aspire add …Provisioning.EntraId shown) |
0 | 0 |
| Links | 45 internal and external links and anchors | 0 | 3 |
Critical issues
None. Nothing I tested was wrong in a way that would stop a user. I didn't run any code; Azure and Entra deployment was out of scope.
Warnings
Warning 1: The Key Vault default role contradicts itself across pages
Location: /integrations/cloud/azure/azure-key-vault/azure-key-vault-host/#role-based-access and the page its new sentence links to, /integrations/security/microsoft-entra-id/client-credentials/#certificate-from-azure-key-vault
- The Key Vault page says: "By default, AddAzureKeyVault configures a Key Vault Administrator built-in role for the consuming project."
- The linked Entra section says: "…which the vault's default Key Vault Secrets User role doesn't allow. Aspire grants the Key Vault Certificate User role automatically."
Issue: A user who follows the new link reads two different default roles. As a blind tester I can't tell which one is right.
Suggestion: Make the two pages agree.
Warning 2: The TypeScript and C# role-assignment samples aren't equivalent
Location: /app-roles/#assign-roles-to-managed-identities
| Tab | Caller (worker) |
API | Identity |
|---|---|---|---|
| TypeScript | addContainer("worker", "my-worker-image") |
addContainer("api", "my-api-image") |
No user-assigned identity; passes worker to publishWithAppRoleAssignment |
| C# | AddDotnetProject |
AddDotnetProject |
AddAzureUserAssignedIdentity("caller-identity") passed to PublishWithAppRoleAssignment |
Issue: The sections that follow show .NET Worker.cs and Program.cs code and rely on AZURE_CLIENT_ID from "a workload with a user-assigned identity". A TypeScript reader with a container and no explicit identity can't connect the sample to that code.
Suggestion: Make the TypeScript tab mirror the C# tab (add a user-assigned identity and use project resources), or explain the workload path explicitly.
Warning 3: The "Experimental API" aside is shown to C# readers
Location: /customize-infrastructure/#customize-the-application-and-service-principal
- Inspecting the page shows the aside is outside the tab set, so it stays visible when C# is selected.
- It says: "The Aspire.Hosting.Azure.Provisioning.EntraId package is experimental and reports the ASPIREAZUREPROVISIONING001 diagnostic."
- The C# panel says: "In C#, the models are available with the Aspire.Hosting.Azure.EntraId package and need no extra package."
- Three similar names appear together:
Aspire.Hosting.Azure.Provisioning.EntraId(package),Aspire.Hosting.Azure.EntraId(package) andAspire.Hosting.Azure.EntraId.Provisioning(namespace).
Suggestion: Move the aside inside the TypeScript tab. It doesn't explain how to acknowledge or suppress the diagnostic in a TypeScript AppHost.
Warning 4: Code is inconsistent if you combine the samples on one page
Location: /expose-and-call-apis/
- The "Set the application ID URI" sample adds
"web"at../Web/Web.csproj. The "Declare permissions and consent" sample then adds"webfrontend"at the same../Web/Web.csproj. - The "Call Microsoft Graph…" TypeScript sample declares
const entraWebagain, after it was already declared under "Declare permissions and consent". It also has animportin the middle of the snippet. - On
/customize-infrastructure/, the page says "Look them up by identifier", but the C# sample looks up the service principal with.OfType<MicrosoftGraphServicePrincipal>().Single(). The TypeScript sample usesgetMicrosoftGraphServicePrincipalByIdentifier("servicePrincipal").
Warning 5: Prose uses C# method names while TypeScript is the default tab
Location: All four Entra pages.
- The prose says
WithScope,WithAdminConsentandWithApplicationIdUri()while the TypeScript tab showswithScopeandwithApplicationIdUri({ applicationIdUri }). - "keep WithApplicationIdUri() for the second deployment" (
/expose-and-call-apis/#retire-a-scope) doesn't say what the TypeScript call with no URI looks like. - The placeholder is written two ways:
api://{clientId}in most places andapi://<client-id>under#validate-audiences.
Warning 6: The phrase "when you write the AppHost" is vague
Examples:
- "Unknown names are rejected when you write the AppHost." (
/expose-and-call-apis/#call-microsoft-graph-and-other-first-party-apis) - "Aspire validates the role names when you write the AppHost" (
/app-roles/) - "Aspire rejects spaces and quotation marks when you write the AppHost." (
/app-roles/)
Issue: I couldn't tell whether this means compile time, the moment the call runs, or aspire run startup. The Existing registrations page is precise ("when your AppHost runs the call, and throws an ArgumentException").
Suggestion: Use that precise wording everywhere.
Warning 7: Some sentences are hard to act on
/expose-and-call-apis/#settings-that-the-caller-receives: "Entries that would collide are rejected before anything starts. Reference API registrations that one client calls from different resources, and give one of two registrations that call the same API its own downstreamApisPrefix." I couldn't work out what to do from this./existing-registrations/#reference-an-existing-registration: "Use AddExistingEntraApplication when the AppHost only references existing registrations." This suggests it's wrong to mix it with created registrations, yet#describe-an-existing-apimixes them (entraWebis a created registration)./existing-registrations/: "In C#, pass either two literals or two parameters. To mix literals and parameters, use the TypeScript AppHost." Telling a user to switch languages is an odd fix.
Warning 8: Two external links redirect
https://learn.microsoft.com/entra/identity-platform/scenario-web-app-call-api-overviewredirects to…scenario-web-app-call-api-app-configuration.…/how-to-assign-app-role-managed-identityredirects to…/assign-app-role-managed-identity-azure-cli.
Both still return 200. Update them to the final URLs.
Passed checks
Tabs
- On all four Entra pages, every tab set lists TypeScript first and C# second, with sync key
aspire-lang. - Choosing C# on one tab set switched all 9 sets on the Expose page.
- The choice persisted to
/app-roles/, where both tab sets showed C#.
Links
- All internal links on the four Entra pages resolve with HTTP 200, use site-relative paths and have trailing slashes.
- All in-page and cross-page anchors exist, for example
/redirect-uris-and-sign-in/#target-a-sovereign-cloud,/client-credentials/#managed-identity-federationand/customize-resources/#inspect-generated-bicep. - All 11 external Learn and Graph links return 200, and their anchors exist (
#add-a-scope-requiring-admin-and-user-consent,#prerequisites,#app-roles-ui,#permissions).
PR-added bits on existing pages
customize-resources: the table row reads "Microsoft Entra ID | Aspire.Hosting.Azure.Provisioning.EntraId | MicrosoftGraphApplication, MicrosoftGraphServicePrincipal, MicrosoftGraphFederatedIdentityCredential". The paragraph "The Microsoft Entra ID package is the exception…" links to/customize-infrastructure/, and clicking it lands on that page's H1.local-provisioning"See also": "Microsoft Entra ID integration" goes to/integrations/security/microsoft-entra-id/, H1 "Microsoft Entra ID integration".user-assigned-identity"See also": the link goes to/app-roles/#assign-roles-to-managed-identities, and the H2 lands at the top of the viewport.azure-key-vault-host"Role-based access": "Certificate from Azure Key Vault" goes to/client-credentials/#certificate-from-azure-key-vault, and the H2 lands at the top of the viewport.
Samples and pages
- The complete AppHost samples define their variables and include imports (
createBuilder, andusing Aspire.Hosting.Azurewhere needed). - The partial snippets clearly continue from earlier samples.
- Previous/Next navigation flows Client credentials → Expose and call APIs → Application roles.
Recommendations
- Priority fixes:
- Resolve the Key Vault default-role contradiction (Warning 1).
- Make the TypeScript and C# app-role assignment samples match (Warning 2).
- Move the experimental aside into the TypeScript tab (Warning 3).
- Documentation gaps:
- Show the TypeScript form of
WithApplicationIdUri()with no URI. - Explain how to suppress
ASPIREAZUREPROVISIONING001in TypeScript. - Explain the second argument of
AddMicrosoftIdentityMessageHandler. - Define "when you write the AppHost".
- Show the TypeScript form of
- Product issues: None observed. Not tested: I ran no code or deployments.
Knowledge gaps
Microsoft.Identity.Web conventions
- What I needed to know: what
[RequiredScope(RequiredScopesConfigurationKey = …)],AddMicrosoftIdentityMessageHandler(section, "DownstreamApis:apiservice"),IDownstreamApiandMapInboundClaimsdo. - Source: prior knowledge, not the docs.
- User impact: non-.NET and new Entra users.
- Recommendation: link to the Microsoft.Identity.Web docs instead of explaining inline.
The https+http:// service discovery scheme
- It's used without explanation. A one-line link to the service discovery docs would cover it.
Delegated vs. application permissions and consent
- These are explained adequately on the Expose and call APIs page. It's reasonable to assume the rest.
AADSTS28000, CannotDeleteOrUpdateEnabledEntitlement, "Enterprise applications list"
- Entra-specific terms with no explanation. They're acceptable as error strings to search for.
Conciseness / relevance findings
| # | Route › heading | Quoted passage | Why it's not useful to a user | Suggested cut or rewrite |
|---|---|---|---|---|
| 1 | expose-and-call-apis › Set the application ID URI | "The client ID exists only after Microsoft Graph creates the registration, so Aspire sets the default api://{clientId} URI in a second update of the registration in the same deployment." | Describes how deployment works internally; the user can't act on it. | Cut. Keep "Without a custom URI, Aspire uses api://{clientId}." |
| 2 | expose-and-call-apis › Set the application ID URI | "Aspire always sets requestedAccessTokenVersion to 2, which exempts the URI from the tenant's default identifier URI policy." | Internal property detail. | Rewrite: "If your tenant enforces a strict identifier URI policy, deployment can fail; see identifier URI formatting errors." |
| 3 | expose-and-call-apis › Set the application ID URI | "Scope IDs derive from the registration and scope names, so they're the same in every deployment and tenant." | How IDs are generated. | Cut to "Set the scope's id to adopt an existing scope." |
| 4 | expose-and-call-apis › Pre-authorize a client | "Each registration deploys as its own module. Pre-authorization makes the API's module wait for the client's ID, while a declaration makes the client's module wait for the API's ID." | Module ordering is internal. | Rewrite: "A pair of registrations can't use both pre-authorization and WithApiPermissions. Choose one." |
| 5 | expose-and-call-apis › Settings that the caller receives | The paragraph starting "{name} is the name of each resource that references the API registration… If no resource references it, {name} is the registration's name with characters other than letters, digits, and underscores replaced by underscores… A custom API uses the letters and digits of the display name…" plus "Entries that would collide…" | Very dense naming rules; most users only need one example key. | Show one concrete key, such as DownstreamApis:apiservice:Scopes:0, and move the full naming rules to a reference table or cut them. |
| 6 | expose-and-call-apis › What a deployment sends (whole section) | "While a registration is declared as an API… Aspire sends its application ID URIs, scopes, and pre-authorized clients in full… Graph replaces each list…" | This describes how Aspire talks to Graph. The user-relevant fact is short. | Replace with: "Portal edits to scopes, URIs, or pre-authorized clients are overwritten on the next deployment. Once nothing declares the API, Aspire stops managing these and leaves them in place." |
| 7 | expose-and-call-apis › Existing API registrations | "Aspire doesn't modify existing registrations. To reference an existing API's scopes, supply its registered URI with WithApplicationIdUri and describe its scopes with WithScope. Set the scope's ID…" | Near-verbatim repeat of existing-registrations › Describe an existing API. | Replace with a one-line link. |
| 8 | expose-and-call-apis › Required privileges for consent and app-roles › Grant the deployer the required permissions | e.g. "For delegated permissions, the identity needs a directory role such as Privileged Role Administrator, Cloud Application Administrator, or Application Administrator, or the DelegatedPermissionGrant.ReadWrite.All…" | Repeated nearly word-for-word in the /lifecycle-and-permissions/ table ("A directory role such as Privileged Role Administrator, Cloud Application Administrator, or Application Administrator, or the DelegatedPermissionGrant.ReadWrite.All Graph permission."). |
Keep it in one place (Lifecycle and permissions) and link to it from both pages. |
| 9 | Several pages: existing-registrations intro, the existing-registrations table, app-roles Caution and Limitations, expose-and-call-apis twice, lifecycle | "Aspire never creates, queries, or modifies an existing registration" / "Aspire never modifies an existing registration" / "Aspire doesn't modify an existing client registration" | Repeated about 6 times across pages. | State it once on Existing registrations and link to it elsewhere. |
| 10 | app-roles › intro, Retire a role, and Limitations | "It doesn't assign roles to users, groups, or applications." (intro and Limitations); "You can't remove the last declared role…" (Retire a role) vs "Aspire can't delete the last declared role, because it sends no appRoles when none remain." (Limitations); "WithAppRole throws for registrations that you add with AddExistingEntraApplication" (Caution) vs "PublishWithAppRoleAssignment throws for existing registrations." (Limitations) | The same limitations appear twice on one page. | Keep each in one section only. Drop "because it sends no appRoles", which is an internal detail. |
| 11 | app-roles › Declare application roles (table) | "passed through to Microsoft Graph"; "When omitted, Aspire derives a stable ID from the registration's resource name and the role value." | Implementation detail. | "Optional. Defaults to a stable ID." |
| 12 | app-roles › Grant the deployer… | "Aspire assigns the role to the identity's principal (object) ID, not to its client ID." | Internal detail unless you're troubleshooting in the portal. | Cut, or move to a troubleshooting tip. |
| 13 | existing-registrations › Choose how to reference the registration | "AddEntraIdApplication enables Azure provisioning before AsExistingApplication runs, and the fluent API doesn't undo that setup." | Describes the internal call order. | Rewrite: "With AsExistingApplication, deployment still requires Azure provisioning configuration." |
| 14 | existing-registrations › Choose how to reference the registration | "Aspire checks this before it changes the resource, so a failed conversion leaves the IDs unchanged." and "An existing registration isn't part of the publish manifest, so deployment generates no Bicep for it." | Internal guarantees and manifest detail. | Cut the first. Shorten the second to "Nothing is deployed for an existing registration." |
| 15 | existing-registrations › Describe an existing API | "Aspire needs the scope ID… because it can't derive the ID that the existing registration defines. Without an application ID URI, GetScopeUri throws, because a guessed URI would fail later as a token error." | The rationale isn't needed. | "Set the scope ID when another registration declares permissions to it. GetScopeUri requires an application ID URI." |
| 16 | existing-registrations › Validation | "After validation, the resource moves from Waiting to Running. When a value is missing or malformed, the resource reports FailedToStart and logs the reason." | Borderline; acceptable as troubleshooting, but long. | Shorten to one sentence. |
| 17 | customize-infrastructure › Select the right declaration | "A registration that exposes an API with the default api://{clientId} application ID URI declares the application a second time, because the client ID is known only after the first declaration deploys. The second declaration repeats the display name and unique name." | Internal Bicep structure; the only action is "select by identifier". | "Always select the application by its Bicep identifier application, because there can be more than one MicrosoftGraphApplication." |
| 18 | customize-infrastructure › Select the right declaration | The list of six proxy model names | Reference trivia; the samples only use two. | Cut, or collapse into a sentence. |
| 19 | customize-infrastructure › Know how the module is generated (whole section) | "The module declares the Microsoft Graph Bicep extension from a pinned registry reference, br:mcr.microsoft.com/…:1.0.0. You don't need a bicepconfig.json…" and "The module outputs clientId, tenantId, objectId, servicePrincipalId, and uniqueName…" | Mostly implementation detail. The useful fact is network reachability. | Keep one note: "The first deployment downloads the Microsoft Graph Bicep extension from mcr.microsoft.com, so that host must be reachable." Cut the rest. |
| 20 | customize-infrastructure › intro | "The module uses the Microsoft Graph Bicep extension to declare the application, the service principal, and any federated credentials, permission grants, and role assignments…" | Overlaps with #19. | Trim to "Use ConfigureInfrastructure to set properties Aspire doesn't model, such as tags and the service management reference." |
Apply the doc review findings: fix the expose-and-call-apis C# sample, give the sovereign Graph sample its own registration, remove claims that the source doesn't support, and cut implementation details. Qualify the x5c rollover claim and add service defaults for the API health endpoint. Co-authored-by: Copilot App <[email protected]>
Use endpoint-derived redirect URIs in the first examples, say app instead of workload, put certificate and managed identity credentials before client secrets, simplify the web app token acquisition sample, drop the experimental diagnostic ID, and remove the Key Vault page cross-reference. Co-authored-by: Copilot App <[email protected]>
## Summary Follow-up to #2086. These changes address the documentation gaps found in the Entra ID hosting integration security review and threat model (microsoft/aspire#21080). That review was an engineering review, not a formal security sign-off. - **Tenant-wide consent (`WithAdminConsent`)** (`expose-and-call-apis.mdx`, `lifecycle-and-permissions.mdx`): Explain that consent applies to the whole tenant without a prompt. Note that Graph application permissions reach deployed apps through managed identity federation. Recommend treating high-privilege permissions as admin access, reviewing consent changes in PRs, and deploying from CI with a least-privilege identity. - **Grants and credentials are never revoked** (`lifecycle-and-permissions.mdx`): Add a new "Revoke what remains" section with Azure CLI and Graph commands that delete grants, app role assignments, and certificate credentials. - **Local developer certificate** (`client-credentials.mdx`): The tenant resource suffix is empty by default. If a run reaches a production registration, it replaces that registration's certificate credentials, and publishing doesn't remove the dev key. The local PFX isn't password protected and isn't cleaned up. - **Vault-wide Key Vault Certificate User role** (`client-credentials.mdx`, `lifecycle-and-permissions.mdx`): Add a caution that the role covers every certificate in the vault, and recommend a dedicated vault. - **Redirect URIs** (`redirect-uris-and-sign-in.mdx`): Aspire passes URIs through as they are, and Entra enforces its own restrictions. Recommend exact HTTPS URIs and restricting who can set host parameters. ## Third-party links and affiliations None. The new links point to Microsoft Learn (`learn.microsoft.com/entra/identity-platform/reply-url`) and the Microsoft Entra admin center. ## Validation - Confirmed that every internal anchor (`#revoke-what-remains`, `#role-assignments-for-certificate-access`, `#managed-identity-federation`, `#required-permissions`) matches an existing heading. - `git diff --check`: passed. - `prettier --check` on the changed files reported issues. It reports the same issues on the unmodified baseline files, so I didn't reformat them. - I didn't run the site build or lint. --------- Co-authored-by: Copilot App <[email protected]> Copilot-Session: 68b00e03-418b-4839-88a1-d0ebfc318f60

Summary
Documents the Microsoft Entra ID hosting integration (epic microsoft/aspire#21060) as one consolidated set of pages under
integrations/security/microsoft-entra-id/. It replaces ten independent bot-written draft PRs that overlapped, edited the same files, and in places contradicted the shipped API. Every claim was checked againstmicrosoft/aspire(README, code,[AspireExport]attributes, polyglot fixtures, tests, and the end-to-end deployment tests).New pages:
index)x5cDownstreamApis, consent, pre-authorization, Graph and custom APIsWithAppRole, retirement rules,PublishWithAppRoleAssignmentfor managed identitiesAddExistingEntraApplicationvsAsExistingApplication, supported vs rejected settingsConfigureInfrastructure, tags,serviceManagementReference, experimentalAspire.Hosting.Azure.Provisioning.EntraId(ASPIREAZUREPROVISIONING001)Other changes: sidebar group under Security & identity, a Microsoft Entra ID row in the Azure provisioning package table, and cross-links from the local provisioning, user-assigned identity, and Key Vault pages.
Superseded drafts (closed after this PR opens): #1928, #1934, #1944, #1964, #1973, #1991, #2027, #2028, #2031, #2043.
Consolidation notes and assumptions
apphost.tstitles, the wrongsyncKey, C# before TypeScript, a nonexistentprereleaseprop onInstallPackage, an unverifiedshortName, aligned fluent indentation, the stale "add URL callbacks beforeWithRedirectUris" note (resolution now waits for all URL customizations), and a claim thatlocal-provisioning.mdxdocuments "Missing subscription configuration".twoslash-annotated because the bundled twoslash data predates the Entra package. The method names and option shapes were verified againstapphost.mtsand the[AspireExport]attributes. C#-only APIs (WithCredential,EntraIdApi,EntraIdApiPermission,EntraIdAppRole) show C# only or use the TypeScript DTO equivalents.integrations.topics.ts.integration-docs.jsonmappings were intentionally not added.reconcileIntegrationDocsprunes official-package entries missing fromaspire-integrations.json, sopnpm test:unit:structured-datafails until the packages appear on NuGet. They can be added by the integrations updater afterwards.<ApiReference>components are used because no generated API data exists for these packages yet.Open questions and unverifiable claims
AzureAdMicrosoft.Identity.Web snippets were checked against Microsoft.Identity.Web source (AddMicrosoftIdentityMessageHandler(IConfiguration, string),EnableTokenAcquisitionToCallDownstreamApi,AddMicrosoftIdentityWebApi) but not executed end to end.WithAllowWebApiToBeAuthorizedByACLfollows the shipped end-to-end deployment test. The exact Microsoft.Identity.Web rejection behavior for tokens withoutrolesis from that test and the option's XML doc.Third-party links and affiliations
None. All added links point to Microsoft-owned sites (learn.microsoft.com, entra.microsoft.com, aka.ms, devblogs.microsoft.com, nuget.org package pages) and the existing aspire.dev docs.
Validation
Run from
src/frontend;pnpm buildwas not run, per repository policy:pnpm install --frozen-lockfile: passedpnpm test:unit:structured-data: passed (5 files, 99 tests)pnpm exec vitest run --config vitest.config.ts: passed (97 files, 1398 passed, 1 skipped), includingseo-lengths,typescript-first-apphost-tabs, andtwoslash-blockspnpm exec eslint config/sidebar/integrations.topics.ts --max-warnings 0: passedpnpm exec prettier --write config/sidebar/integrations.topics.ts: appliedOverviewheadings, non-TypeScript-first tabs, badsyncKey/titles, and missing trailing slashes: clean.starlight-icons/*andtwoslash/aspire.d.tswere restored and are not in the commit