Eric Erhardt
90d · built 2026-11-30
Performance
What Eric Erhardt shipped in the selected window, measured in ETV, and how it compares with the 90 days before it.
Effective capacity
+6.0engineers
delivers like 7.0 (7.0x pre-AI)
Output (ETV)
41.4ETV
+3112.4% vs 1.3 prior
Features share
25.9%
−0.5 pp vs prior window
Fixes share
6.1%
+4.5 pp vs prior window
Work mix
25.9% Features6.4% Maintenance55.7% Tests5.8% Docs6.1% Fixes
73 commits over 90 days, ending 2026-11-30.
Where this dev ranks
Percentile against the global top-100 leaderboard (all-time totals).
- By commits
- Top 83 %
- By Features share
- Top 68 %
Daily performance
Daily ETV, stacked by Features, Maintenance, Tests, Docs and Fixes.
Repository spread
Where this developer's commits land. Concentrated work (top1 > 80%) vs polymath spread (top1 < 30%).
Most impactful commits
Top 10 by ETV in the last 90 days.
- 5.5ETVProvision Microsoft Entra registrations using Azure.Provisioning (#20937) ## Description Allow C# AppHosts to create Microsoft Entra application registrations and service principals through Aspire's Azure provisioning infrastructure. `AddEntraIdApplication(...).AsExistingApplication(...)` references an existing registration while retaining the normal Azure provisioning setup. The new top-level `AddExistingEntraApplication(...)` provides a configuration-only reference without enabling Azure provisioning or requiring Graph access. Both existing-reference APIs accept literal IDs or parameter resources. Builds on merged [#14668](https://github.com/microsoft/aspire/pull/14668). This is the registration-creation foundation, not the complete web-to-API authentication workflow. Automatic redirect URI discovery, credential creation/rotation, API scopes/permissions/consent, and federated identity trust provisioning remain follow-ups. The integration is currently C#-only. No separate issue is closed by this PR. ### Usage and behavior ```csharp var webIdentity = builder.AddEntraIdApplication("entra-web") .WithRedirectUris( "https://localhost:7123/signin-oidc", "https://localhost:7123/signout-callback-oidc"); builder.AddProject<Projects.Web>("web") .WithReference(webIdentity); ``` Created registrations supply client and home-tenant IDs through existing Bicep output references. No implicit readiness/health wait or Azure controller failure/retry refactor is introduced. Caller-added waits remain intact. Registration settings are emitted directly from resource properties. `WithIdTokenIssuance()` enables implicit/hybrid ID-token issuance when needed; it is disabled by default and unnecessary for authorization-code-only flows. Callback URIs must be supplied explicitly. The generated Entra module has only the `tenantResourceSuffix` deployment parameter. It has no `location` or owner-principal parameter and no explicit owner assignments. Microsoft Entra's default ownership behavior applies. This avoids requiring an application/RBAC `principalId` when native `aspire deploy` provisions the registration. Explicit owner configuration is tracked separately in #21030. Provisioning and publishing omit implicit location arguments for generated modules that do not declare location; other modules retain existing behavior. Entra ARM deployments remain resource-group scoped. Explicit subscription/tenant deployment support is not included. ### Naming, provisioning, and cleanup - The Azure provisioning dialog and **Change Azure context** offer an optional tenant-resource suffix for participating provisioned resources. It is persisted, restored, and clearable; `Azure:TenantResourceSuffix` supplies its initial value. - Empty suffix uses the resource name; `dev-a` produces `entra-web-dev-a`. Logical Aspire names and consumer configuration prefixes remain unchanged. Directory identity is determined by tenant/name/suffix, not the resource group. - Published templates expose the suffix with an empty default rather than embedding a developer's local setting. Explicit module values take precedence. Direct deployment binds it from Azure configuration. Changing it invalidates cached outputs, targets another registration, and leaves prior objects intact. - Generate Graph application/service-principal resources and outputs through Azure.Provisioning 1.6.0. Experimental `BicepExtensions` declarations use SDK escaping and pin `br:mcr.microsoft.com/bicep/extensions/microsoftgraph/v1.0:1.0.0`. Bicep 0.36.1+ is required; normal compilation restores the extension. Native SDK support is requested in [Azure/azure-sdk-for-net#63848](https://github.com/Azure/azure-sdk-for-net/issues/63848). - Experimental `TenantScopedResourceAnnotation` identifies tenant-wide non-ARM objects and carries cleanup identification outputs. It is not ARM deployment-scope metadata. - Retain Entra reprovision/cancel/local-state commands while excluding ARM inspection/location/deletion and drift probes. - Allow environment resource-group deletion in mixed models. Preserve directory outputs/state/links and report remaining names/types/object IDs/tenant IDs; reset ordinary ARM state. Reports use stored outputs, not live Graph verification; missing IDs remain unknown. - Existing references do not mutate registrations. Creation requires Azure deployment and appropriate Graph permissions. No API permissions, credentials, or tenant consent are created automatically. `WithFicMsi` requires a user-assigned managed identity client ID and emits configuration only, not identity assignment or federation trust. The playground supports existing/create-new modes selected in AppHost code, dashboard-driven provisioning setup, and a manifest launch profile. Its existing-only mode uses `AddExistingEntraApplication` without enabling Azure provisioning. Generated local artifacts are not committed. Generic manifest scalar/deferred fixes, publisher typed/deferred fixes, automatic parameter-type inference, and `EvaluatedParameters` were reverted as outside this feature's scope. The attempted readiness/controller refactor was also reverted. Shared parameter changes are limited to the agreed suffix handling and omission of undeclared location arguments. The configuration-only factory does not change Azure core registration or pipeline behavior. ### Latest existing-reference validation — `c41e812914` Validation used a task-owned temporary output directory; `$output` is its full path. | Command | Result | | --- | --- | | `dotnet test --project .\tests\Aspire.Hosting.Azure.EntraId.Tests\Aspire.Hosting.Azure.EntraId.Tests.csproj --no-restore --no-launch-profile -p:BuildInParallel=false "-p:OutDir=$output\" --verbosity quiet -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 244 tests, zero failures/skips | | `dotnet build .\playground\EntraId\EntraId.AppHost\EntraId.AppHost.csproj --no-restore -p:SkipNativeBuild=true -p:BuildInParallel=false "-p:OutDir=$output\playground\" --verbosity quiet` | Passed; existing transitive NuGet audit advisories emitted | The regression tests execute an existing-only `deploy` pipeline for both literal and parameter factory overloads, verify that Azure authentication/context steps are not selected, and fail if Azure credentials are requested. They also cover preservation of the fluent API's Azure setup, application pipeline customizations, and mixed Azure/created-Entra models in both addition orders. Azure core files are unchanged by this factory addition. The earlier [native deployment E2E run](https://github.com/microsoft/aspire/actions/runs/38819898987) at `57f9767b8e` passed with 1 executed, 1 passed, and 0 skipped. It covered owner-omitted application/service-principal creation, the output-backed consumer environment and live HTTPS response, stable IDs after a redirect-URI update, and separate directory/resource-group cleanup. The CI identity's retrieved Graph application grants contained `Application.ReadWrite.OwnedBy`, not `Application.ReadWrite.All`. This live run predates the new top-level factory; no new live deployment at `c41e812914` is claimed. ### Earlier source validation — `410e03a55e` Validation used a task-owned temporary output directory to avoid interfering with developer processes. `$output` is the directory created with `Directory.CreateTempSubdirectory(...)`; it was removed afterward. | Command | Result | | --- | --- | | `dotnet test --project .\tests\Aspire.Hosting.Azure.EntraId.Tests\Aspire.Hosting.Azure.EntraId.Tests.csproj --no-restore --no-launch-profile -p:BuildInParallel=false "-p:OutDir=$($output.FullName)\" -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 228 tests, zero failures/skips | | `dotnet build .\src\Aspire.Hosting.Azure.EntraId\Aspire.Hosting.Azure.EntraId.csproj -c Release --no-restore -p:SkipNativeBuild=true -p:BuildInParallel=false -m:1 --verbosity minimal` | Passed for the owner-removal source change | | `az bicep build --file <temporary-main.bicep> --outfile <temporary-main.json> --only-show-errors` | Passed for owner-free parent/Graph/consumer artifacts; compiled Graph parameter shape contains only `tenantResourceSuffix` | | `git diff --check` and `git diff --cached --check` | Passed before publication | Separate publisher/manifest snapshots cover owner/principal removal. Basic Bicep generation is mode-independent and uses a single fact rather than duplicate run/publish snapshots. At preceding head `b8914b3478`, the following command also passed 233 affected Azure tests: `dotnet test --project .\tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj --no-restore --no-launch-profile -p:BuildInParallel=false "-p:OutDir=$($output.FullName)\" -- --filter-class "*.AzureBicepProvisionerTests" --filter-class "*.AzureProvisioningResourceTests" --filter-class "*.AzureEnvironmentResourceTests" --filter-class "*.AzureInfrastructureExtensionsTests" --filter-class "*.AzureEnvironmentResourceExtensionsTests" --filter-class "*.ProvisioningContextProviderTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"`. Shared Azure provisioning code is unchanged by the owner-removal commit. Existing transitive NuGet audit advisories are emitted. No owner-removal-head native AOT/full-solution build or native `aspire deploy` live success is claimed. The locally patched Release DLL successfully published the retained test AppHost without an Entra principal parameter. Current GitHub checks must be read from the PR; local validation does not imply CI is green. Formal API/security review remains outstanding. ### Earlier live and artifact evidence Matching `b8914b3478` dogfood artifacts were verified through real Graph creation/settings/ownership, a healthy .NET consumer and dashboard, cached restart without redeployment, stable-ID callback updates, unmodified published parent/nested deployment with a real output-backed consumer, and suffix isolation followed by restoration of the original identity. User-requested test apps and cloud resources were retained privately for inspection. Those live scenarios explicitly assigned owners and do not establish owner-omitted creation/update behavior or successful native `aspire deploy`. The later user-reported native deploy principal-resolution failure motivated removing default owner assignment and its parameter. Earlier artifact testing at `8a8164c5` also covered eight fresh projects and ten approved scenarios; those task-owned resources were cleaned up. Neither historical run substitutes for testing subsequent revisions. Live destructive cleanup reporting and completed interactive browser authentication remain unverified at the current revision. Private tenant/resource/log evidence is not uploaded. ## Checklist - Is this feature complete? - [ ] Yes. Ready to ship. - [x] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [x] Yes - [ ] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 68b00e03-418b-4839-88a1-d0ebfc318f60github.com-microsoft-aspire · 30c5ba8b · 2026-10-16
- 4.4ETVProvision Entra API identifier URIs, scopes, and caller permissions (#21278) ## Description Completes the delegated web-to-API provisioning slice for `Aspire.Hosting.Azure.EntraId` through Azure.Provisioning-generated Graph Bicep. **API side** - `WithApplicationIdUri()` / `WithApplicationIdUri(string)`: default `api://{clientId}` or a custom URI. - `WithScope(name, description, configure?)`: explicit delegated scopes with stable, derived GUIDs (or an explicit `EntraIdScope.Id`). - `WithPreAuthorizedApplication(client, scopes)`. - `EntraIdApplicationResource.GetScopeUri(scope)` builds the full scope name. **Caller side** - `WithApiPermissions(api, scopes)` for Aspire-modeled APIs and `WithApiPermissions(EntraIdApi, EntraIdApiPermission[])` for first-party APIs (`EntraIdApi.MicrosoftGraph`, `AzureResourceManager`, `AzureStorage`, `FromApplicationId`). Delegated and application permissions stay distinct, names resolve through a catalog, and unknown names are rejected. - `WithAdminConsent(...)` is the only thing that grants anything: delegated scopes become an `AllPrincipals` `oauth2PermissionGrant`, application permissions become `appRoleAssignedTo`. Declaring a permission never consents. A permission must be declared before it is consented. **Configuration flow to consumers** - Referencing a client registration injects one Microsoft.Identity.Web `DownstreamApis` entry per API it declared permissions to: `{root}__{name}__Scopes__{n}`, with full scope URIs for delegated permissions. Application permissions (first-party APIs) are a separate `{name}AppOnly` entry using `.default` and `RequestAppToken=true`. Graph and ARM also get a `BaseUrl`. - For an API registration in the AppHost, `{name}` is the name of each resource that references it (like service discovery); first-party APIs use their display name. Entries with the same name throw. - `WithReference(entra, connectionName, downstreamApisConfigKey)` changes the root key (default `DownstreamApis`). - Referencing a registration that exposes scopes also sets `AzureAd__Scopes` (the enabled scope names, for `[RequiredScope]`). **Design decisions validated against a real tenant** - Self-reference (`api://{clientId}`): a second declaration of the same application under the same `uniqueName` sets `identifierUris` from the first declaration's `appId`. Graph treats this as a PATCH, so nothing from the first declaration is lost. `api://{clientId}` is what default tenant policy accepts; a custom URI is passed through and fails the deployment if tenant policy rejects it. - Scope retirement: Graph rejects removing an enabled scope (`CannotDeleteOrUpdateEnabledEntitlement`). Setting `IsEnabled = false` and deploying, then removing, works and is documented. - Pre-authorization (API module needs the client's ID) and declaration (client module needs the API's ID) would form a module cycle, so using both between the same pair is rejected with a clear error. - Existing registrations stay configuration-only (`WithScope` with an explicit ID and `WithApplicationIdUri` are config). - App role assignment for Aspire-modeled APIs remains a separate roadmap item. ## Validation - `dotnet test` for `Aspire.Hosting.Azure.EntraId.Tests`: 350 passed (new `EntraIdApiProvisioningTests` use Verify snapshots of generated Bicep, plus publish tests for cross-module wiring). - Deployed the generated artifacts (`main.bicep` plus modules) to a test tenant, twice for idempotency: - `identifierUris`, scopes, pre-authorization, `requiredResourceAccess`, `AllPrincipals` grants and the Graph app role assignment were all created and stable across redeployment. - Delegated token through a pre-authorized client: `aud` = the API's client ID, `scp` = the requested scope, with no consent prompt. - App-only token for Microsoft Graph: `roles` = `User.Read.All`, and a Graph call succeeded. App-only token for the API: `aud` = the API's client ID. - Two-step scope retirement (disable, then remove) succeeded. - Test objects in the tenant were deleted afterwards. - Not added: an extension of the Linux-only `AzureEntraIdDeploymentTests` Hex1b E2E, since it cannot run locally. The scenarios above were verified manually. Fixes #21070 ## Checklist - Is this feature complete? - [ ] Yes. Ready to ship. - [x] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [x] Yes - [ ] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1a24c9b5-39fc-4b24-ac51-9b12595eaac5github.com-microsoft-aspire · af8141df · 2026-10-28
- 3.6ETVMove bundled NuGet operations into Aspire CLI (#19847) ## Description Bundled Aspire CLI operations no longer need to start `aspire-managed` to search for, restore, or inspect NuGet packages. The Native AOT `aspire.exe` now calls NuGet.Client APIs in-process, reducing process boundaries while preserving the existing CLI behavior. Non-bundled package search continues to use `dotnet package search`. This adds an in-process `NuGetClient`, rewires the bundle NuGet service and cache, and removes the superseded `aspire-managed nuget` implementations. Package source mapping, signature verification, dependency resolution, extraction, and manifest generation remain supported. The CLI consumes the official NuGet.Client `7.12.0-rc.25` packages from the `dotnet11` feed, pinned through the `NuGetPackageVersionForCli` property in `eng/Versions.props`. The temporary locally-built packages and the repository-local `dist` package source have been removed. The upstream Native AOT work is tracked by [NuGet/Home#14913](https://github.com/NuGet/Home/issues/14913), with the downstream-visible suppression fix in [NuGet/NuGet.Client#7404](https://github.com/NuGet/NuGet.Client/pull/7404). `dotnet11` carries only prerelease `NuGet.*` versions while `dotnet-public` carries only the stable ones the rest of the repository uses, so `NuGet.config` maps `NuGet.*` to both sources at equal specificity. Giving exact patterns to just one source makes it beat the other's wildcard and breaks that consumer with `NU1103`. ### Intentional behavior change: NuGet credential providers The `aspire-managed` helper never set up NuGet's credential service, so bundled search and restore could only authenticate with credentials stored in `nuget.config`; feeds that rely on a credential provider plugin, such as Azure Artifacts, returned 401. The in-process client now initializes the credential service in non-interactive mode, so installed credential providers are used. This is the only intended behavior change. Credential provider diagnostics go only to the debug log, so they cannot change the failure messages described below. ### Behavior parity This change is meant to move the logic between processes, not change it, so the in-process client was compared line by line against the helper and brought back in line wherever it had diverged: - **Restore:** the package spec, restore arguments, settings loading, and source resolution are identical to the helper's. - **Search:** one page per source, deduplicated to one entry per package ID by the highest version *string*, sorted with the default comparer, and capped at the requested count. Failed sources are reported and skipped rather than failing the search. A `--nuget-config` path that does not exist falls back to normal discovery. - **Exact-match lookups** (`GetPackageVersionsAsync`) are an ordinary search whose result with an ordinally matching ID supplies the versions, rather than a package-metadata query merged across sources. - **Failure messages** keep the helper-era text: `Package restore failed: …`, `Manifest creation failed: …`, and the localized search failure message. The embedded detail is the helper's stderr, reconstructed with the same prefixes, verbose filtering, and trailing error lines. - **Logging:** NuGet's output is logged at Debug, as the helper's stderr was. - **`DOTNET_NUGET_SIGNATURE_VERIFICATION`** is set only for the duration of a restore, as the helper only ever received it itself, instead of leaking into every child process the CLI starts afterwards. - **Trust store:** an initialization failure is reported and the restore continues. - **Process state:** NuGet keeps process-wide state between operations: the credential service with its cached credentials, credential provider plugin processes, the HTTP throttle, and other caches. The helper discarded it by exiting after every operation, so the client raises NuGet's own end-of-build reset when the last overlapping operation ends. - **Restore cache key:** sources are sorted, so their order does not force a new restore, and the key fingerprints the binary that performs the restore. A settings fingerprint added earlier in this PR was removed: it hashed the per-invocation temporary config path, so the cache never hit. - **Bundle extraction for `aspire doctor`:** on `main`, bundled NuGet search extracted the bundle before launching `aspire-managed`, and the background CLI update check runs that search on startup, so the bundle was on disk by the time `aspire doctor` looked for DCP. In-process NuGet no longer extracts it, so the DCP health check now does: it asks layout discovery first, exactly as on `main`, so an `ASPIRE_DCP_PATH` override or an already extracted bundle still wins, and extracts the bundle only when discovery finds nothing. This was the only code relying on NuGet search having extracted the bundle. A few differences are inherent to running in-process under Native AOT: NuGet moves from `7.9.0` to `7.12.0-rc.25`; NuGet's System.Text.Json deserialization is enabled and Newtonsoft's serialization, component-model, and dynamic features are disabled (see below); the Linux trust store is initialized through `X509TrustStore.InitializeForDotNetSdk` instead of `DispatchProxy`, using the same embedded SDK certificate bundles; and NuGet operations no longer require an extracted bundle layout or hold a bundle lease. Per-source search failures log the exception type rather than its message, because NuGet formats feed URLs, including credentials, into those messages. ### Native AOT and Newtonsoft.Json `7.12.0-rc.25` still reaches Newtonsoft.Json in places, so `Aspire.Cli.csproj` disables Newtonsoft's serialization, component-model, and dynamic feature switches. The dynamic-dispatch warnings that remain surface from `Microsoft.CSharp` and `System.Linq.Expressions`, which are collapsed to one warning per assembly. Both can be removed once NuGet drops Newtonsoft.Json entirely ([NuGet/NuGet.Client#7601](https://github.com/NuGet/NuGet.Client/pull/7601)). ### User-facing usage Existing commands continue to work without starting `aspire-managed` for bundled NuGet operations: ```text aspire integration list ``` Validation: - Repository restore completed successfully, with the CLI resolving `7.12.0-rc.25` from `dotnet11` and `Aspire.RuntimeIdentifier.Tool` resolving stable `7.9.0` from `dotnet-public` on a cold package cache. - NuGet client, bundle service, package-cache, signature-verification, DCP health check, and `PrebuiltAppHostServerTests` passed: 246 succeeded. - The tests that run real restores, manifests, and searches also passed (170 succeeded) with the CLI's exact runtime switches applied, confirming none of the disabled Newtonsoft paths are reached at runtime. - Native AOT `win-x64` publish completed with no ILC diagnostics, using the feature switches and per-assembly warning collapsing described above. - A dogfood build of an earlier commit created and ran TypeScript AppHosts end to end: `aspire new`, `aspire add`, and `aspire run` for both `aspire-ts-empty` and `aspire-ts-starter`, including a cold-cache restore that produced byte-identical generated modules. Fixes # (issue) ## Checklist - Is this feature complete? - [ ] Yes. Ready to ship. - [x] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: baa86aab-4a9f-44c7-a92e-34f6498c9e4egithub.com-microsoft-aspire · b8fc7f62 · 2026-09-23
- 3.6ETV[release/13.6] Move bundled NuGet operations into Aspire CLI (#20391) Backport of #19847 to release/13.6 /cc @eerhardt ## Customer Impact Bundled (Native AOT) Aspire CLI installs run NuGet search, restore, and manifest generation through the `aspire-managed` helper, which pollutes the dependencies in `aspire-managed`. As a result, user's integrations dependencies can get mangled with NuGet's dependencies. This change moves those operations into the CLI process, which calls NuGet.Client directly with credential providers enabled. It also removes a helper-process launch from every NuGet operation. Everything else behaves as before. ## Testing - Unit tests for the in-process client and its callers: search/restore/manifest parity, source mapping, `NUGET_PACKAGES` and `globalPackagesFolder`, signature-verification scoping, and restore-cache reuse. On release/13.6, all 221 tests in the affected `Aspire.Cli.Tests` classes pass (2 skipped), and `Aspire.Managed.Tests` and `Aspire.Hosting.RemoteHost.Tests` pass. - Native AOT publish on release/13.6 produces no IL diagnostics. - Full CI passed on main. - Manual end-to-end validation of the PR build against the main daily build ([report](https://github.com/microsoft/aspire/pull/19847#issuecomment-5797751726)) covered: - .NET and TypeScript create, search, add, update, and start - cold and warm restore - an authenticated Azure Artifacts feed - package source mapping, and search with one feed unreachable - RID-specific, native, and satellite assets - `aspire doctor` right after a fresh install Search results, manifests, and generated TypeScript were identical to main. ## Risk Medium. The change is large (42 files) and replaces the NuGet search, restore, and manifest code that every bundled CLI uses, and it moves the CLI to NuGet.Client 7.12.0-rc.25. It was checked line by line against the helper and compared end to end with main. The only intended behavior change is credential-provider support. One side effect: a feed that can't be authenticated non-interactively now waits on the credential provider, as `dotnet restore` does, instead of failing immediately with 401. ## Regression? No. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: baa86aab-4a9f-44c7-a92e-34f6498c9e4egithub.com-microsoft-aspire · 30ea12b1 · 2026-09-23
- 2.2ETVUpdate repository CLI manifests with aspire update (#20295) ## Description Repositories can pin the Aspire CLI independently of the executable currently running. Plain `aspire update` now updates those repository-local pins alongside AppHost integrations, instead of treating them as a `--self` operation. Related to #15252. `aspire update --self` is unchanged. Repository CLI updates are intentionally manifest-only; restoring/installing the updated CLI and refreshing its lockfile remain the repository package manager's responsibility. - Updates existing `Aspire.Cli` entries in `.config/dotnet-tools.json` or `dotnet-tools.json`, and `@microsoft/aspire-cli` entries in `package.json`. - Works without an AppHost when a repository CLI reference exists. Discovery starts from the selected AppHost or working directory and searches ancestor directories for the nearest CLI references, like `Directory.Packages.props` lookup. It checks `.config/dotnet-tools.json` before `dotnet-tools.json` at each level. The .NET search stops at the first `isRoot: true` manifest even if it has no Aspire entry; npm lookup continues independently. Unsupported AppHosts retain their SDK-discovery error rather than falling back to manifest-only updates. - Preserves unrelated entries and exact npm pins or full-version `^`/`~` prefixes. Unsupported specifiers produce a warning. - The manifest-update step leaves npm, pnpm, and Yarn lockfiles untouched and prints restore/install guidance. No new restore/install step is introduced. - CLI manifest edits share the confirmation and apply phase with integration and `aspire.config.json` changes. For .NET AppHosts, these edits all happen before restore, so a restore failure does not prevent CLI pins from being saved. Manifest-only updates do not trigger AppHost restore. - Guest AppHosts retain regenerate-before-save behavior: CLI pins are applied alongside config saving after successful SDK regeneration and dependency installation. Unrelated manifest edits made during that process are preserved; changes to the approved CLI references are rejected. - Does not offer executable self-update when repository CLI references exist. If a guest AppHost needs a newer CLI before its SDK can be regenerated, updates the repository pins and asks the user to restore and rerun instead. If the pins are already current but the running CLI is older, it still prints the applicable .NET/npm restore/install guidance without rewriting manifests or claiming that pins changed. This works without an archive download URL or downloader. Declining a pin update continues to the project update without reoffering the declined CLI pins. .NET pins resolve through the selected package channel. npm uses `latest` for stable/default updates; an explicit non-stable channel requires its exact CLI version to exist on npm. There are no new package dependencies. ### User-facing usage ```bash aspire update --channel stable --yes --non-interactive ``` Command help: ```text Description: Update integrations and repository Aspire CLI references Usage: aspire update [options] ``` After updating pins, the command prints: ```text Repository Aspire CLI references updated. The running CLI was not replaced. Run 'dotnet tool restore' in the repository to use the updated .NET tool. Ensure its NuGet configuration includes the selected channel's feed. Lockfiles were not changed. Run your package manager's install command (for example, 'npm install') to refresh the lockfile and use the updated npm tool. ``` For npm, users can alternatively run `npm install --package-lock-only` to refresh only the lockfile. `npm ci` can fail until the manifest and lockfile agree. Existing guest-project dependency installation retains its normal lockfile behavior; the separate CLI-pin edit does not install the newly selected CLI or refresh its lockfile entry. ### Validation - Latest guidance fix, published in `9bb5aaa39c`: 153 focused updater and command tests passed. The .NET-only, npm-only, and combined current-pin cases failed before the fix and now verify applicable guidance exactly once, unchanged manifest bytes, and no false update-success message. - Focused update suite for the simplification published in `73c8b508f7`: 294 passed, 2 platform-specific skips, no failures. Includes ancestor lookup across Git directories/worktree files and ordinary updates through file/directory symlinks. - Added regular-CI Hex1b `RepositoryToolUpdateTests`: acceptance and decline scenarios verify the confirmation prompt, restore/install guidance, exact/range pins, unrelated fields, unchanged lockfiles and executable, and no package installation/lifecycle execution. Both previously passed against the source CLI in a Linux container; they have not been rerun against the latest head. - Regression coverage verifies both manifests, SDK/integration versions, and project config are already updated when .NET restore fails; one shared confirmation, decline, manifest-only updates without restore, guest regeneration failure, and preservation of installer-edited npm fields are also covered. - [Independent artifact test report](https://github.com/microsoft/aspire/pull/20295#issuecomment-5770688586) covers nine scenarios on the original `c15012b6` build, including interactive acceptance/rejection and C# AppHost orchestration. ### Screenshots / Recordings > **This PR includes UI changes.** Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally. > > - For before/after comparisons, place them side-by-side or label them clearly. > - For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video). > - If you cannot capture visuals now, note what scenario to test and mark this section as TODO. TODO: Capture the CLI version-change messages and restore/install guidance using the command above in a repository with both tool manifests. The text excerpt above is from the local smoke test; no visual recording is attached. Committed Hex1b tests exercise both interactive acceptance and decline. ### Security considerations The new update step writes discovered tool manifests using ordinary filesystem operations, consistent with other project-file updates, and reuses the existing NuGet/npm metadata-resolution paths. Malformed manifests produce explicit errors. The manifest-update step does not introduce an install command or execute lifecycle scripts. Existing AppHost integration-update restore behavior is retained. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No Fixes: #15252 --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 5f7cdcb1 · 2026-09-22
- 1.9ETVExport Entra ID hosting integration to polyglot AppHosts (#21361) ## Description Enables polyglot AppHosts to use the Entra ID hosting integration, including new registrations, configuration-only references to existing registrations, consumer settings, all built-in credential kinds, owners, deferred redirect URIs, application roles, API scopes and permissions, admin consent, and managed-identity federation. Fixes #21076 Supersedes #21292, whose coverage is included here: Rust fixture plus Rust runner compilation, CI routing for every fixture language, and generic `withReference` dispatch coverage. Existing C# signatures and behavior are preserved, as is the package's preview versioning. Overloaded C# APIs remain available; internal ATS adapters expose one typed capability per concept. Entra references use the existing generic `withReference` dispatcher rather than introducing a competing export. - Tenant and client IDs independently accept literals or parameter resources. - Top-level `addExistingEntraApplication` does not enable Azure provisioning or query Graph. Fluent `asExistingApplication` retains previously enabled Azure setup. - Endpoint redirects remain deferred through run and publish, and secret/password parameters retain secret tracking. - Exports `withAppRole(value, displayName, description, { allowedMemberTypes, id, isEnabled })` over the new `EntraIdAppRole` API; the generated Bicep matches the C# call. - Exports `withApplicationIdUri`, `withScope`, `getScopeUri`, `withPreAuthorizedApplication`, `withApiPermissions` and `withAdminConsent` for registrations in the AppHost, plus `withExternalApiPermissions`/`withExternalApiAdminConsent` for Microsoft Graph and other APIs (well-known API enum or custom API DTO). `withEntraIdReference` is the only way to set the `DownstreamApis` prefix, since the generic `withReference` dispatcher has no slot for it. - Adds behavior and generated TypeScript contract coverage, adds dedicated Go, Java, Python, Rust and TypeScript `tests/PolyglotAppHosts/Aspire.Hosting.Azure.EntraId` fixtures that exercise every export, updates test routing, and documents TypeScript usage. ### Examples Existing C# AppHosts continue to work unchanged: ```csharp var tenantId = builder.AddParameter("entra-tenant"); var clientId = builder.AddParameter("entra-client"); var secret = builder.AddParameter("entra-secret", secret: true); var entra = builder.AddExistingEntraApplication("entra", tenantId, clientId) .WithClientSecret(secret); builder.AddContainer("worker", "my-worker-image") .WithReference(entra, connectionName: "AUTH"); ``` Generated TypeScript supports mixed ID inputs and typed credential arguments: ```typescript const tenantId = await builder.addParameter("entra-tenant"); const secret = await builder.addParameter("entra-secret", { secret: true }); const entra = await builder.addExistingEntraApplication( "entra", tenantId, "00001111-aaaa-2222-bbbb-3333cccc4444") .withClientSecret(secret); await builder.addExecutable("worker", "node", ".", ["worker.mjs"]) .withReference(entra, { connectionName: "AUTH" }); ``` New registrations support deferred endpoint redirects and publish-time federation: ```typescript const entra = await builder.addEntraIdApplication("entra"); const web = await builder.addContainer("web", "my-web-image") .withHttpEndpoint({ targetPort: 8080 }) .withReference(entra); await entra.withRedirectUris(await web.getEndpoint("http"), { callbackPaths: ["/signin-oidc"], }); await entra.publishWithFederatedManagedIdentityCredential({ identity: web }); ``` ### Security considerations This exposes existing identity and credential configuration through ATS; it does not install or configure workload authentication libraries, add scopes/consent, or change authorization behavior. Client secrets and certificate passwords require secret parameters. Existing registrations are never modified. Creating registrations and federation trust still requires the existing Azure/Graph permissions; owners can manage registrations. Certificate and assertion paths identify files on the consumer, not files read by the AppHost. ### Validation The following commands were run on Windows: | Command | Result | | --- | --- | | `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'` | Passed, 452 tests | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` | Passed, 153 tests | | `dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-launch-profile -- --filter-namespace 'Infrastructure.Tests.TestTriggerMap' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` | 314 passed, 22 failed: Windows bash-path failures in `PrComparisonBaseTests` and access-denied cleanup of temporary Git objects in `SelectTestsCliTests` | | `dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-launch-profile -- --filter-namespace 'Infrastructure.Tests.TestTriggerMap' --filter-not-class '*.PrComparisonBaseTests' --filter-not-class '*.SelectTestsCliTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` | Passed, 255 map, acceptance, and graph tests | | `dotnet run --project tools\SelectTests -- --changed-files artifacts\entra-polyglot\changed-files.txt --explain` | All changed files attributed; selected Entra, Azure, TypeScript codegen, and infrastructure tests plus polyglot/API compatibility jobs | | `dotnet build src\Aspire.Cli\Aspire.Cli.csproj --nologo -v:q /p:SkipNativeBuild=true` | Passed | | `Set-Location` into a copy of each `tests\PolyglotAppHosts\Aspire.Hosting.Azure.EntraId` fixture (local project mapping), then `aspire restore` and `npm run build` / `go build ./...` / `pyright` / `javac --enable-preview --source 25` / `cargo check` | All five passed, mirroring the CI polyglot validation scripts | | `git diff --check` | Passed | Manual verification used the locally built CLI (`dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll`) and a temporary generated TypeScript AppHost: ```powershell dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll restore --apphost artifacts\entra-polyglot\apphost.mts --non-interactive dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll start --non-interactive --isolated --apphost artifacts\entra-polyglot\apphost.mts --format Json dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll describe --apphost artifacts\entra-polyglot\apphost.mts --format Json dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll logs consumer --apphost artifacts\entra-polyglot\apphost.mts --non-interactive dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll stop --apphost artifacts\entra-polyglot\apphost.mts --non-interactive dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll publish --apphost artifacts\entra-polyglot\apphost.mts --output-path artifacts\entra-polyglot\publish-existing --non-interactive --include-exception-details dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll deploy --apphost artifacts\entra-polyglot\apphost.mts --output-path artifacts\entra-polyglot\deploy-existing --non-interactive --include-exception-details $env:ENTRA_SCENARIO='create' dotnet .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll publish --apphost artifacts\entra-polyglot\apphost.mts --output-path artifacts\entra-polyglot\publish-created --non-interactive --include-exception-details ``` All commands succeeded. Existing registrations reported healthy, and a Node consumer exited successfully after asserting its injected configuration, including secret and certificate password values. Configuration-only publish/deploy completed without Azure provisioning steps. New-registration publish generated Graph application/service-principal Bicep, owners, managed-identity federation, and environment-derived redirect URLs; the templates were inspected. The validation AppHost was stopped. After rebasing onto main (including #21357), generated TypeScript AppHosts calling `withAppRole` and the scope/permission/consent exports published successfully; the Bicep contained the expected `appRoles`, identifier URIs, scopes and pre-authorized clients, and the consumer received the expected `DownstreamApis` configuration. No live Azure/Graph mutation was performed. Existing NU1903 advisories for `System.Security.Cryptography.Xml` were not changed. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [x] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 759b89fe · 2026-10-28
- 1.7ETVSimplify Aspire.Cli process code using .NET 11 Process APIs (#17079) ## Description .NET 11 adds `System.Diagnostics.Process` APIs that cover most of the process plumbing Aspire.Cli used to write by hand (see https://devblogs.microsoft.com/dotnet/process-api-improvements-in-dotnet-11/). This PR moves the CLI onto those APIs and deletes the custom code they replace. Net change vs `main`: 48 files, +803 / -3,924 lines. ### `ProcessExecution` uses `Process.Start` directly; `IsolatedProcess` is gone - Deletes `IsolatedProcess` (all platforms), `WindowsConsoleProcessJob`, and nearly all of `WindowsProcessInterop`. Only `SetConsoleCtrlHandler` remains, and `Program.cs` still uses it. - `ProcessExecutionFactory.CreateProcessStartInfo` maps the CLI launch options onto `ProcessStartInfo`: - **Stdin:** always the null handle, so children see EOF (#16791). Detached children also get null stdout/stderr. - **Windows, `IsolateConsole` / `KillOnParentExit` / `Detached`:** - `CreateNoWindow = IsolateConsole` gives the child its own hidden console for targeted CTRL+C. - `KillOnParentExit` replaces the hand-rolled kill-on-close job, assigned atomically at creation. - `InheritedHandles = []` means the child inherits only the std handles. - **Unix, detached:** `StartDetached` (`setsid`) replaces the DCP `fork-process` launcher, as #18678 anticipated. The child stays a direct child, so its PID and exit code are observable, and no bundle/layout lease is needed. - `ProcessExecution` reads output with `Process.ReadAllLinesAsync`, so `WaitForExitAsync` doesn't wait on pipes a grandchild holds open. - `AgentTelemetryUploader` uses `Process.StartAndForget`. - I checked with a real DCP binary: `dcp stop-process-tree` still delivers CTRL+C to a child started with `CreateNoWindow` + `KillOnParentExit` + `InheritedHandles = []`. ### One-shot commands - **`RunAndCaptureText[Async]`:** the agent CLI version probes (Claude Code, Copilot, OpenCode, VS Code, Playwright), `UpdateCommand`, `CertificateHelpers` (5-second timeout), OpenSSL and macOS `security` calls, `GitRepository`, `NpmRunner`, `DeprecatedWorkloadCheck`, and the Deno version check. - **`Process.Run(..., silent: true)`:** WSL PowerShell trust and the macOS trust commands. - **`ReadAllLinesAsync`:** `DotNetSdkInstaller` streams `dotnet --list-sdks`. - **Removed launches:** - `CliDownloader` no longer runs `ldd --version`. It detects musl from `RuntimeInformation.RuntimeIdentifier` (via `IEnvironment`), which NativeAOT sets to the publish RID. - `DotNetBasedAppHostServerProject` reuses `IDotNetCliRunner.GetNuGetConfigPathsAsync` instead of its own `dotnet nuget config paths` launch. - **Deleted helpers:** `CertificateProcessRunner` and `ProcessOutputReader`, with their tests. ### Sites that keep custom code Each has a comment explaining why the new APIs don't fit: - **`DotNetSdkInstaller` and `UnixCertificateManager.RunCertUtil`:** kill the whole process tree on cancel. The runtime helpers only kill the root process. - **`ProcessCaptureRunner` (`PeerInstallProbe`):** caps output at 1 MiB per stream, kills the tree on timeout, and bounds the post-exit drain. - **`MacOSCertificateManager` find-certificate:** captures stdout only. ### Follow-up #20618 tracks routing the remaining direct `Process` launches through `IProcessExecutionFactory`. Those call sites already bypassed the factory on `main`. ### Behavior changes to review - Captured text no longer goes through BOM detection. Output is decoded with the configured or default encoding. - On cancellation or timeout: - git and the Deno check now kill only the root process (previously the whole tree); - npm now kills the root process (previously nothing was killed). - Isolated Windows children get `CREATE_NO_WINDOW` instead of `CREATE_NEW_CONSOLE | SW_HIDE`. Both give the child its own hidden console. - Non-detached Unix children get `/dev/null` stdin instead of a closed pipe. Both read as EOF. - Detached Unix children are started with `setsid` directly instead of through DCP `fork-process`. - `ProcessExecution` stdout and stderr line callbacks are now serialized rather than concurrent. - On Unix, environment variables whose names differ only by case (e.g. `http_proxy` / `HTTP_PROXY`) are passed through to children instead of being collapsed. - `AppHostServerSessionTests` now uses `ping` instead of `cmd /c pause` as its long-running Windows command. `pause` exits right away on EOF stdin, so the "still running" assertions raced under load. ### Validation - Aspire.Cli and Aspire.Cli.Tests build with 0 warnings on `11.0.100-rc.1.26425.128`. - **New tests** in `ProcessExecutionTests` / `ProcessExecutionDetachedTests`: - Windows launch-option mapping; - CTRL+C delivered through the child's own console; - valid null stdin; - a shared stdout/stderr handle; - output callbacks that throw; - a Unix detached child in a new session. - **Targeted runs on Windows** (quarantined and outerloop excluded): - `DotNetSdkInstaller`, `UnixCertificateManager`, `MacOSCertificateManager` and `ProcessExecutionDetached` tests: 46 passed, 7 skipped (non-Windows). - `AppHostServerProject`, `ScaffoldCache`, `ChannelResolution`, `AppHostServerSession` and `CliDownloader` tests: 45 passed, 1 failed. The failure is a Verify snapshot line-ending mismatch caused by CRLF files in my local checkout; this PR doesn't touch that snapshot. - Linux and macOS coverage (`StartDetached`, certificate managers) comes from CI. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d695e49d-5cf6-48f3-bc17-90538e743090github.com-microsoft-aspire · 9122c274 · 2026-10-01
- 1.6ETVProvision Entra federation trust from Aspire managed identities (#21227) ## 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 #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? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [x] 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 - [x] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5fd51945-1cef-4047-aee3-548389684c71github.com-microsoft-aspire · 0008228e · 2026-10-23
- 1.6ETVAdd experimental Azure Container Apps Express support (#20115) ## Description Add experimental, opt-in Azure Container Apps Express deployment support for HTTP applications, without replacing the existing Container Apps environment API. Users select `.AsExpress()` on an environment in C# or TypeScript. Express is emitted as `properties.environmentMode: "Express"` on `Microsoft.App/managedEnvironments` — it is not a separate Aspire environment type, package, publisher, or CLI command. Environments without `.AsExpress()` keep their existing behavior and generated artifacts, and local `aspire run` orchestration is unchanged. Express defaults to zero minimum replicas and omits the implicit Consumption workload profile, managed Aspire dashboard, and .NET platform data-protection configuration. Explicit customization is preserved and passed to Azure to validate; Aspire does not maintain an Express service-capability matrix. App-to-app references resolve to `https://<app-name>.<environment-default-domain>`, exactly as standard Container Apps already does. Fixes #19034 ### User-facing usage C# AppHost: ```csharp #pragma warning disable ASPIREACAEXPRESS001 builder.AddAzureContainerAppEnvironment("env").AsExpress(); #pragma warning restore ASPIREACAEXPRESS001 var api = builder.AddProject<Projects.Api>("api") .WithExternalHttpEndpoints(); builder.AddProject<Projects.Frontend>("frontend") .WithExternalHttpEndpoints() .WithReference(api); ``` ### Scope and limitations - Uses the `2026-03-02-preview` API version for the Express environment and its container apps. The pinned `Azure.Provisioning.AppContainers` does not expose `EnvironmentMode`, so a small unmodeled-property shim emits it without adding dependencies. It is marked for removal once the SDK models the property. - Express has no private `.internal` hostname, so referencing an internal-only endpoint fails with guidance to expose it explicitly or use a standard environment. `WithReference` never makes a private endpoint public. - `AsExpress()` combined with `WithHttpsUpgrade(false)` is rejected during Bicep generation, in either call order, because Express requires HTTPS ingress. - Existing environments can be declared Express with `.AsExisting(...).AsExpress()`. This is an AppHost-author declaration; Aspire does not verify or convert the deployed environment's mode. - Azure's [Express documentation](https://learn.microsoft.com/en-us/azure/container-apps/express-overview) currently lists Aspire as unsupported. This experimental integration does not change Azure's support policy. ### Security considerations Express references use public HTTPS endpoints. Both the referencing app and the referenced API must be explicitly exposed with `WithExternalHttpEndpoints()`; `WithReference` neither exposes a private endpoint nor adds authentication, so applications must enforce their own authorization. Existing secure-parameter/manual-secret handling and user-assigned managed-identity ACR pulls are preserved — secrets remain `secretRef` values rather than literal environment variables. Security review should confirm the public-reference behavior and secret handling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>github.com-microsoft-aspire · ed4523d2 · 2026-09-17
- 1.4ETVAdd local developer certificate credentials for Entra applications (#21382) ## Description Aspire-created Entra registrations can sign users in without a client credential, but authorization-code redemption and downstream token acquisition need one. This adds an opt-in local developer certificate credential, avoiding client secrets and never provisioning a private key into Entra. `RunWithLocalDeveloperCertificateCredential()` creates a dedicated 48-hour RSA signing certificate per Entra resource in the AppHost-specific Aspire store. A subsequent run reuses it while more than 24 hours remain; otherwise it atomically overwrites the same owner-protected PFX file. Only public DER certificate material is embedded in the run-mode Bicep template; changing it invalidates the deployment checksum. Referencing workloads receive the matching private PFX through a secret parameter using `SourceType = Base64Encoded` and `Base64EncodedValue`. Aspire declares the selected certificate as the registration's entire `keyCredentials` collection and lets Graph assign the credential ID. Deployment replaces existing keys, including unexpired predecessors; there is no separate Graph read or merge. A newly persisted certificate is retained after a provisioning failure for retry. Existing registrations remain caller-managed, and publish mode neither generates nor emits local credentials. The method is exported to polyglot AppHosts (`runWithLocalDeveloperCertificateCredential` in TypeScript and the equivalent in Python, Go, Java, and Rust). It is covered by the polyglot fixtures and by tests that invoke the exported capability. Certificate generation is extracted from the CLI into `src/Shared/CertificateFactory.cs`, source-linked by both the CLI HTTPS certificate manager and the Entra integration. The shared factory retains RSA-2048/SHA-256 signing and the existing subject/authority key identifier handling. HTTPS-specific extensions and Entra-specific validity, storage, and renewal remain with their respective callers. The Entra playground has an opt-in authorization-code/Graph `/me` scenario (`useLocalCertificate`, off by default). An MVC controller using Identity.Web's `AuthorizeForScopes` restarts interactive sign-in for incremental-consent and conditional-access challenges; the default and Node sign-in flows are unchanged. Fixes #21071 ### User-facing usage ```csharp // Use distinct registration names or Azure:TenantResourceSuffix values for development and production. var entraWeb = builder.AddEntraIdApplication("entra-web") .RunWithLocalDeveloperCertificateCredential() .PublishWithFederatedManagedIdentityCredential(); builder.AddProject<Projects.Web>("web").WithReference(entraWeb); ``` ```typescript const entraWeb = await builder.addEntraIdApplication("entra-web"); await entraWeb.runWithLocalDeveloperCertificateCredential(); await entraWeb.publishWithFederatedManagedIdentityCredential(); ``` For the playground, keep `useExistingApplication = false` and set `useLocalCertificate = true` in `playground/EntraId/EntraId.AppHost/AppHost.cs`. In run mode, the .NET frontend then uses authorization code flow with PKCE and can call Graph `/me` after user consent. ### Security considerations - **Development and production must use separate Entra registrations.** Different resource groups do not isolate tenant-scoped registrations, and excluding a local credential from publish does not revoke a key previously registered against the same application. - Private PFX files live under `IAspireStore.BasePath/dev-certs/Entra/<resource-name>.pfx`, with owner-only Windows ACLs or Unix permissions. Renewal retains no private-key generations; stable lock files coordinate access and interrupted temporary writes are cleaned up. - Base64 is not encryption. The PFX is a secret runtime environment value, accessible to the referenced workload and sufficiently privileged host/container tooling. It is not a deployment parameter, image-build input, certificate mount, or published artifact. - Aspire owns the development registration's entire certificate credential collection. Deployments replace unrelated keys and unexpired predecessors; older sessions using a replaced certificate must restart. Use dedicated developer registrations rather than sharing with independently managed certificate credentials. - The provisioning identity needs Graph application creation/update permissions: delegated `Application.ReadWrite.All`, or application `Application.ReadWrite.OwnedBy` for owned registrations, subject to tenant policy. Workloads do not need Graph application-management permissions. - Renewal is checked at AppHost startup, not by a background timer. Restart development sessions before certificate expiry. Formal security review remains outstanding. ### Validation - Passed **477 tests**: `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"`. - Passed **46 tests**, with **7 platform-specific skips**, after the latest rebase onto `main`: `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-namespace "Aspire.Cli.Tests.Certificates" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"`. Includes shared-factory signing, supplied key identifiers, and HTTPS extension regression coverage. - Passed: `dotnet build playground\EntraId\EntraId.Web\EntraId.Web.csproj -o artifacts\entra-mvc-web-output -v:q`. - Passed earlier in this PR (not rerun after the final rebase): `Aspire.Hosting.Azure.Tests` `BicepUtilitiesTests` (34 tests), a playground AppHost build into an isolated output directory, and `az bicep build` of the run-mode template with the pinned Graph extension. Coverage includes renewal thresholds, isolation, overwrite/recovery, contention/cancellation, Windows ACLs, the single-public-key Bicep shape, renewal-driven checksum changes, secret sensitivity, direct secret resolution without provisioning waits, publish exclusion, polyglot capability export, and loading the private key through Microsoft.Identity.Web and verifying its signature with the published public key. Certificate rotation/update against Graph was exercised manually by the author. **Not yet validated:** a generated TypeScript/Python/Go/Java/Rust AppHost run against the new export, the polyglot store location, actual container execution, and non-Windows filesystem behavior. API review and formal security review are pending. Test restore reports existing NU1903 advisories for `System.Security.Cryptography.Xml` 10.0.10; dependency versions were not changed. ## Checklist - Is this feature complete? - [ ] Yes. Ready to ship. - [x] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [x] Yes - [ ] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Mitch Denny <midenn@microsoft.com>github.com-microsoft-aspire · a76b57a9 · 2026-10-30