Skip to content

Provision Entra federation trust from Aspire managed identities - #21227

Merged
Eric Erhardt (eerhardt) merged 28 commits into
mainfrom
eerhardt-entra-federation-trust-managed-identity
Oct 23, 2026
Merged

Eric Erhardt (eerhardt) merged 28 commits into
mainfrom
eerhardt-entra-federation-trust-managed-identity

Conversation

@eerhardt

@eerhardt Eric Erhardt (eerhardt) commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

Adds publish-time APIs that make an Aspire-created Entra ID app registration trust the user-assigned managed identity of the workload that uses it, so a deployed app authenticates with no client secret or certificate.

  • PublishWithFederatedManagedIdentityCredential() trusts the managed identity of every resource that references the registration.
  • PublishWithFederatedManagedIdentityCredential(computeResource) trusts one compute resource, which must reference the registration. Only that resource receives the credential.
  • PublishWithFederatedManagedIdentityCredential(identity) trusts an explicit AzureUserAssignedIdentityResource.
  • WithFederatedManagedIdentityCredential(clientId) (renamed from WithFicMsi) is configuration-only and is the option for existing registrations. It applies in run mode too, and the registration must already trust the identity.
  • ManagedIdentityRequiredAnnotation (new, public, experimental ASPIREAZURE003): AzureResourcePreparer gives the annotated compute resource a managed identity even when it has no role assignments. Referencing an Entra app adds it.

For a registration Aspire creates, the generated Bicep adds a Microsoft.Graph/applications/federatedIdentityCredentials resource: issuer is the tenant's v2.0 endpoint, subject is the identity's principal ID, audience is the cloud's token exchange audience (public, US Government, China; other clouds fail with a clear error). The workload receives the identity's client ID as ManagedIdentityClientId.

Behavior to be aware of:

  • Aspire never modifies existing registrations, so the PublishWith... overloads throw for AddExistingEntraApplication. (Same inconsistency for other registration-only APIs is tracked in Entra ID: throw when registration-only APIs are used with existing registrations #21256.)
  • A validation step runs after azure-prepare-resources and fails with the resource name when a trusted compute resource has no managed identity.
  • The environment value for ManagedIdentityClientId is resolved lazily, because the preparer evaluates environment callbacks (and a callback's result is cached) before it attaches identities.
  • The credential is skipped in run mode; use another credential for local development.

Fixes #21072

Validation

  • Aspire.Hosting.Azure.EntraId.Tests (281 passed) and Aspire.Hosting.Azure.Tests for the preparer change.
  • Deployed an ACA web + API app to a test tenant with aspire deploy using the PR build. The deployed app acquires an app token as the registration using only the managed identity assertion; a wrong federated subject or audience fails with AADSTS700213 / AADSTS7002121; redeploys are idempotent.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Add PublishWithFederatedManagedIdentityCredential overloads that make an Entra
application registration trust the user-assigned managed identity of each
referencing compute resource, a specific compute resource, or an explicit
identity. Add ManagedIdentityRequiredAnnotation so the Azure resource preparer
gives such resources an identity even without role assignments.

Fixes #21072

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21227

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21227"

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 20, 2026 23:15
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Oct 20, 2026
@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

Identity lifecycle ordering breaks automatic-identity publishing and explicit-identity local provisioning, and generated credential names can exceed Graph limits.

3 open issues
What changed in this PR

Adds managed-identity federation trust provisioning to Aspire’s Entra ID integration.

Changes:

  • Adds publish-time federation APIs for all consumers, one compute resource, or an explicit identity.
  • Generates Graph federation credentials and requests workload identities without role assignments.
  • Updates documentation, unit tests, and Bicep snapshots.
File Description
tests/​Aspire.Hosting.Azure.Tests/​AzureUserAssignedIdentityTests.cs Tests identity creation and reuse.
tests/​Aspire.Hosting.Azure.EntraId.Tests/​Snapshots/​EntraIdProvisioningTests.WithFederatedManagedIdentityCredential_Identity_GeneratesFederatedCredential.verified.bicep Captures explicit-identity trust.
tests/​Aspire.Hosting.Azure.EntraId.Tests/​Snapshots/​EntraIdProvisioningTests.WithFederatedManagedIdentityCredential_ConsumerIdentity_GeneratesCredentialPerConsumer.verified.bicep Captures per-consumer trust.
tests/​Aspire.Hosting.Azure.EntraId.Tests/​EntraIdResourceBuilderTests.cs Updates renamed API tests.
tests/​Aspire.Hosting.Azure.EntraId.Tests/​EntraIdProvisioningTests.cs Tests federation configuration and validation.
tests/​Aspire.Hosting.Azure.EntraId.Tests/​EntraIdInitializationTests.cs Uses the renamed credential API.
src/​Aspire.Hosting.Azure/​ManagedIdentityRequiredAnnotation.cs Adds an identity-requirement annotation.
src/​Aspire.Hosting.Azure/​AzureResourcePreparer.cs Creates identities for annotated resources.
src/​Aspire.Hosting.Azure.EntraId/​README.md Documents federation workflows.
src/​Aspire.Hosting.Azure.EntraId/​Provisioning/​FederatedIdentityCredential.cs Models Graph federation credentials.
src/​Aspire.Hosting.Azure.EntraId/​Provisioning/​EntraIdBicepConstants.cs Adds the federation resource type.
src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs Adds publish APIs and consumer configuration.
src/​Aspire.Hosting.Azure.EntraId/​EntraIdFederation.cs Maps cloud-specific token audiences.
src/​Aspire.Hosting.Azure.EntraId/​EntraIdApplicationResource.cs Generates trust and resolves credential identities.

Review effort: Balanced

The Azure resource preparer evaluates environment callbacks to discover
dependencies before it attaches each resource's identity, so the managed
identity credential must not require the identity when it is emitted.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Credential registration remains call-order dependent, and deployed token exchange lacks end-to-end coverage.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Handle credential registration regardless of call order

src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs:1335

Identity creation depends on call order when using WithCredential. If a workload calls WithReference(entra) before entra.WithCredential(new EntraIdFederatedIdentityCredential()), this check sees no credential, and WithCredential never annotates the recorded consumers. Without other role assignments, the Azure preparer creates no identity and publish-time client ID resolution throws. Apply the identity requirement to existing consumers in the shared credential-registration path, and test both call orders through resource preparation.

Low severity Add deployed federation and token exchange integration tests

src/​Aspire.Hosting.Azure.EntraId/​EntraIdApplicationResource.cs:260

The new tests verify Bicep and configuration, but not deployed federation. AzureEntraIdDeploymentTests currently echoes tenant/client IDs without enabling federation or exchanging a managed-identity assertion. Extend it to deploy an Azure Container Apps workload with the attached identity, acquire a downstream token through the registration using the emitted configuration, and verify this again after redeployment. Include wrong-subject/audience rejection cases. This covers identity attachment, deployment ordering, and authentication behavior that snapshots cannot establish.

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Valid China authority configurations are rejected, and credential call order can prevent required workload identity creation.

2 open issues
3 previously missed issues

In code that hasn't changed since last review

Medium severity Ensure consumer identity for credentials regardless of call order

src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs:1335

The new consumer-identity mode depends on call order through WithCredential. If a workload calls WithReference(entra) before entra.WithCredential(new EntraIdFederatedIdentityCredential()), this check sees no credential, and WithCredential only appends it. Without another identity requirement, the Azure preparer creates no identity and publishing fails in ResolveIdentity. Have WithCredential call EnsureManagedIdentityRequired for existing consumers when adding a credential with UsesConsumerIdentity, and test both call orders.

    /// This setting only affects registrations created by Aspire. Existing registrations are not modified;
    /// enable "ID tokens (used for implicit and hybrid flows)" in their Authentication settings instead.
    /// </para>
Medium severity Support Azure China authority mapping

src/​Aspire.Hosting.Azure.EntraId/​EntraIdFederation.cs:34

The valid Azure China authority login.chinacloudapi.cn falls through to null. A resource-backed credential configured with this instance is therefore rejected by ValidateProvisioningConfiguration, despite China being supported. Recognize this host alongside login.partner.microsoftonline.cn and add a mapping regression test.

Low severity Add deployed federation and token exchange coverage

src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs:666

The new tests verify generated Bicep, annotations, and environment values, but not deployed federation. AzureEntraIdDeploymentTests deploys a registration and echoes IDs; it never exchanges a managed-identity assertion. Add an Azure Container Apps web-to-API scenario that verifies identity attachment, downstream token acquisition without a deployed secret, repeat deployment, and rejection of incorrect subjects/audiences. Snapshots cannot establish that the provider accepts the trust or that token exchange succeeds.

Review effort: Balanced

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.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

Raw resource-backed credentials can break local provisioning, and audience overrides can conflict with generated federation trust.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Reject resource-backed credentials with mismatched token audiences

src/​Aspire.Hosting.Azure.EntraId/​EntraIdApplicationResource.cs:176

Resource-backed credentials can specify TokenExchangeUrl through WithCredential, but this validation checks only whether the cloud is supported. Environment emission honors the override while generated federation trust always uses the cloud's default audience. For example, a US Government registration with a public-cloud audience override requests assertions that do not match its generated trust, so authentication fails after provisioning. Reject resource-backed overrides that differ from the supported cloud audience and add a mismatch regression test. Leave configuration-only credentials unchanged.

Low severity Add regression coverage for compute-resource overload scoping

src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs:763

The compute-resource overload has no focused regression coverage; the federation tests exercise only the parameterless and explicit-identity overloads. Add a test with two referencing workloads and another credential that verifies only the selected identity is trusted, only that workload receives the federated credential, and both credential arrays have contiguous indexes. Also cover before-start rejection of a selected workload that never references the registration. These tests exercise the new scoping and validation branches without requiring a live deployment.

2 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

…entity

The public constructor takes the client ID of a managed identity Aspire does not manage. Aspire-managed identities are set through internal constructors, so a raw WithCredential cannot make the registration's Bicep reference an identity that is not provisioned when running.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

The compute-scoped overload needs focused regression coverage for trust isolation, credential indexing, and unreferenced-target validation.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Add regression coverage for compute-resource workload scoping

src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs:758

The compute-resource overload has no regression coverage: the federation tests call only the parameterless or explicit-identity overloads. Omitting ComputeTarget would broaden trust to every consumer without failing those tests. Add a focused publish-mode test in EntraIdProvisioningTests.cs with two referencing workloads that selects only one. Verify that generated trust includes only its identity and check both workloads' complete credential configuration, including contiguous indexes when another credential follows the scoped one. Also add an unreferenced-target case that exercises the pipeline validation. These tests protect Aspire's workload-scoping contract without requiring a deployed token-exchange test.

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

15 / 100 PR test projects · 3 PR jobs, from 26 changed files.

Selected PR test projects (15 / 100)

Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests

Selected PR jobs (3)

extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 7 of the 15 selected test projects come from a single change — src/Aspire.Hosting.Azure.AppContainers/BaseContainerAppContext.cs.

🔧 src/Aspire.Hosting.Azure.AppContainers/BaseContainerAppContext.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests
→ 6 via the project graph: Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

🔧 src/Aspire.Hosting.Azure/AzurePublishingContext.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests
→ 6 via the project graph: Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (2 hops), Aspire.Hosting.CodeGeneration.Python.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.Foundry.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests (2 hops)

🔧 src/Aspire.Hosting.Azure.EntraId/EntraIdApplicationResource.cs (changed source)
→ 2 directly: Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure.EntraId/EntraIdFederation.cs (changed source)
→ 2 directly: Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure.EntraId/EntraIdResourceExtensions.cs (changed source)
→ 2 directly: Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure.EntraId/Provisioning/EntraIdBicepConstants.cs (changed source)
→ 2 directly: Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure.EntraId/Provisioning/FederatedIdentityCredential.cs (changed source)
→ 2 directly: Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureAppServiceTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests
→ 1 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests

🔧 src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure/AzureResourcePreparer.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure/IBicepOutputReferenceProvider.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure/ManagedIdentityRequiredAnnotation.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/EntraIdInitializationTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/EntraIdProvisioningTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/EntraIdResourceBuilderTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/MicrosoftIdentityWebConfigurationTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/Snapshots/EntraIdProvisioningTests.Publish_FederatedManagedIdentityCredential_PublishesConsumerIdentityClientId.verified.bicep (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/Snapshots/EntraIdProvisioningTests.WithFederatedManagedIdentityCredential_ConsumerIdentity_GeneratesCredentialPerConsumer.verified.bicep (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.EntraId.Tests/Snapshots/EntraIdProvisioningTests.WithFederatedManagedIdentityCredential_Identity_GeneratesFederatedCredential.verified.bicep (changed test)
→ 1 directly: Aspire.Hosting.Azure.EntraId.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureUserAssignedIdentityTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureAppServiceTests.EnvironmentVariableWithBicepOutputReferenceProviderIsPublishedAsItsOutput.verified.bicep (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureContainerAppsTests.EnvironmentVariableWithBicepOutputReferenceProviderIsPublishedAsItsOutput.verified.bicep (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureEnvironmentResourceTests.AzurePublishingContext_PublishesBicepOutputReferenceProviderAsItsOutput.verified.bicep (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/TestBicepOutputReferenceProvider.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

Job reasons

Job Triggered by
extension-e2e affected project Aspire.Hosting.Azure.Functions
polyglot • affected project Aspire.Hosting.Azure.AppContainers
• affected project Aspire.Hosting.Azure.Provisioning.AppContainers
typescript-api-compat affected project Aspire.Hosting.Azure.AppContainers

Selection computed for commit 687bce6.

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.

🔵 Needs a closer look

The compute-scoped overload needs focused regression coverage for trust isolation, selective credential emission, and missing-reference validation.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Add regression coverage for compute-resource identity scoping

src/​Aspire.Hosting.Azure.EntraId/​EntraIdResourceExtensions.cs:758

The compute-resource overload has no focused regression coverage; the federation tests call only the parameterless and explicit-identity overloads. Its distinct contract is to trust only the selected workload and omit its credential from other consumers. Add tests in Aspire.Hosting.Azure.EntraId.Tests with two consumers using different identities, select one through this overload, and verify the generated trust and both consumers' credential configuration. Include another credential after the scoped entry to check that skipping it leaves no index gaps, and verify that validation rejects a target that never calls WithReference. These are unit-level checks of Aspire's scoping behavior, not deployment or token-exchange tests.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@sebastienros Sébastien Ros (sebastienros) 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.

It's missing the polyglot apphosts usage AspireExportIgnore

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.

LGTM — focused review found no high-confidence issues. passes; no tests were run.

@eerhardt
Eric Erhardt (eerhardt) merged commit 0008228 into main Oct 23, 2026
269 of 273 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 23, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1944

Generated by PR Documentation Check · copilot · auto · 33 AIC · ⌖ 1.18 AIC · ⊞ 7.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1944 targeting release/17.0.

Added a new Microsoft Entra ID integration page documenting PublishWithFederatedManagedIdentityCredential, WithFederatedManagedIdentityCredential (renamed from WithFicMsi) and ManagedIdentityRequiredAnnotation, plus a sidebar entry. Signals: integration_readme_changed (EntraId/README.md), new_public_type (ManagedIdentityRequiredAnnotation), experimental_attribute_added (ASPIREAZURE003), defaults_or_constants_file_changed (EntraIdBicepConstants.cs).

Note

This draft PR needs human review before merging.

@IEvangelist

Copy link
Copy Markdown
Member

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: 687bce6
  • Installed Version: 17.0.0-pr.21227.g687bce6a
  • Status: ✅ Verified

Changes Analyzed

  • Azure hosting and Entra ID provisioning APIs, managed-identity preparation, generated Bicep, documentation, and tests.
  • No CLI implementation, Dashboard, VS Code extension, template, or CI infrastructure changes.

Test Scenarios Executed

Scenario 1: Fresh AppHost publish with explicit managed identity federation

Objective: Verify the PR CLI packages compile the documented API and generate deployable Azure Bicep.
Coverage Type: Happy path
Status: ✅ Passed

Steps:

  1. Created a fresh �spire-empty C# AppHost from the PR hive.
  2. Added Aspire.Hosting.Azure, Aspire.Hosting.Azure.AppContainers, and Aspire.Hosting.Azure.EntraId version 17.0.0-pr.21227.g687bce6a.
  3. Added an Azure Container Apps environment, explicit user-assigned identity, Entra application, federated credential, and container reference.
  4. Ran �spire publish with the installed PR CLI.

Evidence:

  • �pphost.cs
  • resh-app-publish.log
  • main.bicep
  • �ntra-web.bicep
  • web.bicep

Observations:

  • All 12 publish pipeline steps succeeded.
  • The generated Entra module contains Microsoft.Graph/applications/[email protected].
  • Issuer is the tenant v2.0 endpoint, subject is the identity principal ID, and audience is �pi://AzureADTokenExchange.
  • The container receives the Entra client ID and the identity client ID through the generated environment variables and is assigned the user-assigned identity.

Scenario 2: Entra ID hosting test suite

Objective: Validate provisioning, environment projection, supported-cloud audiences, existing-registration behavior, and managed-identity validation paths.
Coverage Type: Happy path and unhappy path
Status: ✅ Passed

Command:
dotnet test --project tests\Aspire.Hosting.Azure.EntraId.Tests\Aspire.Hosting.Azure.EntraId.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Result: 298 passed, 0 failed, 0 skipped.

Expected unhappy-path outcomes verified by the suite:

  • A referenced compute resource without a user-assigned identity fails with a resource-specific validation error.
  • Existing registrations are configured rather than provisioned with a new federated credential.
  • Unsupported managed-identity token-exchange audiences fail clearly.

Evidence: �ntra-tests.log

Scenario 3: Azure hosting test suite

Objective: Validate managed-identity preparation and Bicep output reference propagation across Azure hosting resources.
Coverage Type: Regression and boundary coverage
Status: ✅ Passed

Command:
dotnet test --project tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Result: 2,085 passed, 0 failed, 5 skipped (pre-existing emulator skips).

Evidence: �zure-tests.log

Summary

Scenario Status Notes
Artifact version verification ✅ Passed Installed CLI matches PR head 687bce6
Fresh AppHost publish ✅ Passed Federation and identity Bicep generated correctly
Entra ID hosting tests ✅ Passed 298/298 passed
Azure hosting tests ✅ Passed 2,085 passed; 5 pre-existing skips

Overall Result

✅ PR VERIFIED

The tested PR artifact and exact source commit behave as intended. Live Azure deployment was not repeated because it requires tenant credentials; the PR author documented a successful ACA deployment and token acquisition test in the PR description.

Notes

NuGet emitted existing vulnerability warnings for repository dependency versions during test builds. They did not fail either test project and are not introduced by this PR.

@eerhardt

Copy link
Copy Markdown
Member Author

It's missing the polyglot apphosts usage AspireExportIgnore

Yep - I'm getting the C# API first, and then will do the Aspire exports all at once before we ship.

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

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provision Entra federation trust from Aspire user-assigned managed identities

4 participants