Skip to content

Quarantine failing staging self-update test - #19733

Merged
Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
mitchdenny-quarantine-self-update-test
Aug 27, 2026
Merged

Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
mitchdenny-quarantine-self-update-test

Conversation

@mitchdenny

Copy link
Copy Markdown
Member

Description

Quarantines SelfUpdateToStaging_RelaunchedCliUsesStagingForImplicitProjectUpdate so its current package-provenance failure no longer blocks unrelated pull requests while the underlying fix in #19731 is reviewed.

The test now carries [QuarantinedTest] linked to #19708. Regular CI excludes it, while the quarantine workflow retains coverage until the underlying issue is resolved.

Validation:

  • Built Aspire.Cli.EndToEnd.Tests successfully.
  • Confirmed MTP discovers the test with quarantined=true.
  • Confirmed MTP excludes the test with the regular quarantine and outerloop filters.

Addresses #19708

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

- Quarantined: SelfUpdateToStaging_RelaunchedCliUsesStagingForImplicitProjectUpdate
- Issue: #19708

The test currently fails because the persisted staging route resolves a stable SDK from a retired per-commit feed.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 27, 2026 02:44
@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 -- 19733

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

1 / 102 test projects · 1 job, from 1 changed file.

Selected test projects (1 / 102)

Aspire.Cli.EndToEnd.Tests

Selected jobs (1)

extension-e2e


How these were chosen — grouped by what changed

🧪 tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

Job reasons

Job Triggered by
extension-e2e tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs

Selection computed for commit e4a0327.

@mitchdenny
Mitch Denny (mitchdenny) enabled auto-merge (squash) August 27, 2026 02:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Quarantines the failing staging self-update E2E test while its underlying fix is reviewed.

Changes:

  • Adds the QuarantinedTest attribute linked to issue #19708.
  • Imports the required test utilities namespace.
Show a summary per file
File Description
tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs Quarantines the affected self-update test.

Review details

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: 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.

@mitchdenny
Mitch Denny (mitchdenny) merged commit 5503571 into main Aug 27, 2026
780 of 783 checks passed
@mitchdenny
Mitch Denny (mitchdenny) deleted the mitchdenny-quarantine-self-update-test branch August 27, 2026 03:23
@github-actions github-actions Bot added this to the 13.6 milestone Aug 27, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_optional → test_only

Triggered signals: none (signal_count == 0, recommendation == "docs_optional").

Allowlist justification: The only changed file is tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs (2 additions, 0 deletions), which matches tests/**. This satisfies only_test_or_build_changes and no source files changed, matching the test_only allowlist category exactly.

What the PR does: Adds a [QuarantinedTest] attribute (linked to #19708) to SelfUpdateToStaging_RelaunchedCliUsesStagingForImplicitProjectUpdate so a flaky package-provenance failure no longer blocks unrelated PRs while the real fix in #19731 is reviewed. This is purely internal test-infrastructure bookkeeping — no user-facing behavior, CLI surface, API, or configuration changed. No documentation update is needed.

Mitch Denny (mitchdenny) added a commit to spboyer/aspire that referenced this pull request Aug 27, 2026
…t#19733

PR microsoft#19733 quarantines this test with [QuarantinedTest] linked to microsoft#19708,
which preserves quarantine-workflow coverage until the root cause is fixed
in microsoft#19731. Our earlier [ActiveIssue] change skipped the test everywhere
(including the quarantine workflow) and touched the same method, causing a
merge conflict. Remove it so microsoft#19733 owns disabling this test and this
branch leaves the file unchanged from base.

Co-authored-by: Copilot App <[email protected]>
Mitch Denny (mitchdenny) added a commit that referenced this pull request Aug 27, 2026
The test quarantined by #19733 is now hermetic: self-update installs an
archive of the current-source CLI served from a loopback-only feed, and
package resolution uses a local hive supplied through the install sidecar.
It no longer depends on a live darc feed containing a matching
Aspire.AppHost.Sdk, which was the source of the original flakiness.

Removes the QuarantinedTest attribute and the now-unused
Aspire.TestUtilities using (IDE0005 is an error in this repo).

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754
Mitch Denny (mitchdenny) added a commit that referenced this pull request Aug 27, 2026
* Isolate source AppHost deployment state

Co-authored-by: Copilot <[email protected]>

* Harden deployment state loading and replacement

Co-authored-by: Copilot <[email protected]>

* Clarify deployment state clearing messages

Co-authored-by: Copilot <[email protected]>

* Preserve scalar state migration semantics

Co-authored-by: Copilot <[email protected]>

* Fix claimed parent migration authority

Co-authored-by: Copilot <[email protected]>

* Preserve authoritative migrated section state

Co-authored-by: Copilot <[email protected]>

* Fix deployment state migration edge cases

Co-authored-by: Copilot <[email protected]>

* Preserve deployment state manager compatibility

Co-authored-by: Copilot <[email protected]>

* Isolate deployment state identity from AppHost path

Co-authored-by: Copilot <[email protected]>

* Canonicalize deployment paths by filesystem semantics

Co-authored-by: Copilot <[email protected]>

* Merge concurrent nested state additions

Co-authored-by: Copilot <[email protected]>

* Harden deployment state locking and clearing

Co-authored-by: Copilot <[email protected]>

* Harden deployment state fallback merging

Co-authored-by: Copilot <[email protected]>

* Harden deployment state load against edge cases from review

LoadDeploymentState now computes state paths inside the try/catch so an
environment name containing characters outside [a-zA-Z0-9_-] degrades to
skipping the best-effort load instead of throwing ArgumentException from
builder construction in publish mode.

FileDeploymentStateManager only locks and reads legacy state when the
legacy file exists. This avoids manufacturing a phantom legacy directory
and lock file for identities that never had legacy state (e.g. brand-new
source AppHosts on a clean machine) and avoids re-coupling sibling
AppHosts that share the legacy identity on that shared lock.

Adds regression tests that fail without each fix.

Co-authored-by: Copilot App <[email protected]>

* Disable SelfUpdateChannelPersistenceTests pending fix

The test fails in PR CI and is tracked by #19708, which has a separate
fix in progress. Mark it [ActiveIssue] so it does not block unrelated PRs.

Co-authored-by: Copilot App <[email protected]>

* Harden authoritative state recovery

Co-authored-by: Copilot <[email protected]>

* Revert SelfUpdateChannelPersistenceTests disable in favor of #19733

PR #19733 quarantines this test with [QuarantinedTest] linked to #19708,
which preserves quarantine-workflow coverage until the root cause is fixed
in #19731. Our earlier [ActiveIssue] change skipped the test everywhere
(including the quarantine workflow) and touched the same method, causing a
merge conflict. Remove it so #19733 owns disabling this test and this
branch leaves the file unchanged from base.

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>
Mitch Denny (mitchdenny) added a commit that referenced this pull request Aug 28, 2026
Restores the project-update leg of the test and makes its restore
hermetic via the install sidecar's `packages` field, rather than
removing the step that fails.

Without `packages`, the relaunched CLI derives its Aspire feed from the
identity it just persisted (darc-pub-microsoft-aspire-<commit>). Once
that staging build is promoted to GA the feed stops carrying a matching
Aspire.AppHost.Sdk, which is the reported failure in #19708. Pinning
`packages` at the harness hive removes that dependency, and
InstallSidecarWriter.PrepareForSelfUpdate rewrites only
channel/version/commit, so the field survives the self-update.

This restores two behaviours the test was written to cover: that the
persisted identity channel lands in a project's aspire.config.json, and
the "AppHost predates the self-update" scenario users actually hit.

The second `aspire update --self` is dropped because it cannot coexist
with `packages`: once the sidecar's channel is staging, the synthesized
local-hive channel replaces the same-named built-in channel
(PackagingService.GetChannelsAsync) and a local hive has no
CliDownloadBaseUrl, so self-download fails with "Channel 'staging' does
not support CLI downloads". The project update asserts the same
persistence more strongly, via the resulting config.

Also drops the [QuarantinedTest] attribute added by #19733 while
resolving the merge with main, so the fix actually runs in CI.

Validated: 3 consecutive passing E2E runs against ASPIRE_E2E_ARCHIVE,
with quarantined and outerloop tests excluded. Recording confirms the
relaunched process is the published staging binary
(13.5.3+b5f143315ffb6968ea939a9978797a5b20e4c688), not a local no-op.
UpdateCommandTests theory: 4 passed.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754
Mitch Denny (mitchdenny) added a commit that referenced this pull request Aug 29, 2026
* feat: add Azure Container Apps Sandboxes target

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix: address Azure Sandboxes review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix: scope Azure sandbox cleanup ownership

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* test: make container output assertion portable

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* test: avoid cmd echo trailing whitespace

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix: configure sandbox build options on target creation

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address Azure Sandboxes review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Harden Azure Sandboxes APIs and retries

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Secure sandbox diagnostics and image inspection

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Strengthen image argument boundary tests

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address Azure Sandboxes deployment review

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address sandbox scope and cleanup review

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Fix sandbox group resource naming

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix(ats): support TimeSpan values in DTOs

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* docs(sandboxes): cite data owner role

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Fix polyglot sandbox ownership isolation

Use source AppHost file identity for deployment-state isolation while migrating legacy state paths, and derive sandbox ownership from the canonical AppHost identity. Keep publish-only sandbox resources out of run mode and document the TypeScript API.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Emit required sandbox group properties

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Fix deployment state migration path resolution

Co-authored-by: Copilot <[email protected]>
Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae

* Address Azure sandbox review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae

* Fix sandbox state and principal migration

Co-authored-by: Copilot <[email protected]>

* Address Azure sandbox follow-up review

Make publish helpers inert during run mode, prune previous generations when immutable images change, and reconcile create response-loss by deployment labels.\n\nCo-authored-by: Copilot <[email protected]>

* Isolate source AppHost deployment state

Co-authored-by: Copilot <[email protected]>

* Harden Azure sandbox deployment lifecycle

Co-authored-by: Copilot <[email protected]>

* Add typed container image inspection results

Co-authored-by: Copilot <[email protected]>

* Harden deployment state loading and replacement

Co-authored-by: Copilot <[email protected]>

* Clarify deployment state clearing messages

Co-authored-by: Copilot <[email protected]>

* Handle ADC role assignment propagation

Co-authored-by: Copilot <[email protected]>

* Preserve scalar state migration semantics

Co-authored-by: Copilot <[email protected]>

* Fix claimed parent migration authority

Co-authored-by: Copilot <[email protected]>

* Preserve authoritative migrated section state

Co-authored-by: Copilot <[email protected]>

* Harden sandbox security replacement cleanup

Co-authored-by: Copilot <[email protected]>

* Classify role-less app-only Azure tokens

Co-authored-by: Copilot <[email protected]>

* Fix deployment state migration edge cases

Co-authored-by: Copilot <[email protected]>

* Preserve deployment state manager compatibility

Co-authored-by: Copilot <[email protected]>

* Address sandbox runtime review feedback

Co-authored-by: Copilot <[email protected]>

* Handle optional Azure user name claims

Co-authored-by: Copilot <[email protected]>

* Prune retained sandboxes with runtime configuration

Co-authored-by: Copilot <[email protected]>

* Isolate deployment state identity from AppHost path

Co-authored-by: Copilot <[email protected]>

* Use deployment identity for sandbox ownership

Co-authored-by: Copilot <[email protected]>

* Canonicalize deployment paths by filesystem semantics

Co-authored-by: Copilot <[email protected]>

* Merge concurrent nested state additions

Co-authored-by: Copilot <[email protected]>

* Allow composite connection endpoints through sandbox egress

Co-authored-by: Copilot <[email protected]>

* Harden deployment state locking and clearing

Co-authored-by: Copilot <[email protected]>

* Prune retained sandboxes for modeled commands

Co-authored-by: Copilot <[email protected]>

* Use existing sandbox scope for cleanup

Co-authored-by: Copilot <[email protected]>

* Harden deployment state fallback merging

Co-authored-by: Copilot <[email protected]>

* Clarify existing sandbox identity support

Co-authored-by: Copilot <[email protected]>

* Harden deployment state load against edge cases from review

LoadDeploymentState now computes state paths inside the try/catch so an
environment name containing characters outside [a-zA-Z0-9_-] degrades to
skipping the best-effort load instead of throwing ArgumentException from
builder construction in publish mode.

FileDeploymentStateManager only locks and reads legacy state when the
legacy file exists. This avoids manufacturing a phantom legacy directory
and lock file for identities that never had legacy state (e.g. brand-new
source AppHosts on a clean machine) and avoids re-coupling sibling
AppHosts that share the legacy identity on that shared lock.

Adds regression tests that fail without each fix.

Co-authored-by: Copilot App <[email protected]>

* Disable SelfUpdateChannelPersistenceTests pending fix

The test fails in PR CI and is tracked by #19708, which has a separate
fix in progress. Mark it [ActiveIssue] so it does not block unrelated PRs.

Co-authored-by: Copilot App <[email protected]>

* Harden authoritative state recovery

Co-authored-by: Copilot <[email protected]>

* Revert SelfUpdateChannelPersistenceTests disable in favor of #19733

PR #19733 quarantines this test with [QuarantinedTest] linked to #19708,
which preserves quarantine-workflow coverage until the root cause is fixed
in #19731. Our earlier [ActiveIssue] change skipped the test everywhere
(including the quarantine workflow) and touched the same method, causing a
merge conflict. Remove it so #19733 owns disabling this test and this
branch leaves the file unchanged from base.

Co-authored-by: Copilot App <[email protected]>

* Fix response-loss cleanup cancellation assertion

Co-authored-by: Copilot <[email protected]>

* Address sandbox analyzer and endpoint feedback

Co-authored-by: Copilot <[email protected]>

* Address sandbox deployment review feedback

Co-authored-by: Copilot <[email protected]>

* Harden sandbox create reconciliation and egress

Co-authored-by: Copilot <[email protected]>

* Address sandbox cleanup and digest feedback

Co-authored-by: Copilot <[email protected]>

* Use managed identity for sandbox image pulls

Move ADC disk image creation to the V2 managed identity contract and keep sandbox-specific provisioning out of the shared Azure hosting infrastructure.

Co-authored-by: Copilot <[email protected]>

* Stabilize response-loss visibility test

Allow enough reconciliation time for Windows timer granularity while retaining the one-millisecond poll interval.

Co-authored-by: Copilot <[email protected]>

* Clarify sandbox workload identities

Co-authored-by: Copilot <[email protected]>

* Fix sandbox image pull identity handling

Avoid sending the ACR pull identity for public registry images, reject pull/workload identity reuse, and require existing pull identities for existing sandbox groups.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ccb1419b-3f5f-4cb3-8933-b0bb1762ed48

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>
Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542
Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae
Copilot-Session: ccb1419b-3f5f-4cb3-8933-b0bb1762ed48
Karol Zadora-Przylecki (karolz-ms) added a commit that referenced this pull request Aug 31, 2026
* Fix Issue 19708

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 7e17da02-39b1-4fa1-ac25-144eb6fcb904

* Eliminate false positive

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Make the restore hermetic instead of dropping the project update

Restores the project-update leg of the test and makes its restore
hermetic via the install sidecar's `packages` field, rather than
removing the step that fails.

Without `packages`, the relaunched CLI derives its Aspire feed from the
identity it just persisted (darc-pub-microsoft-aspire-<commit>). Once
that staging build is promoted to GA the feed stops carrying a matching
Aspire.AppHost.Sdk, which is the reported failure in #19708. Pinning
`packages` at the harness hive removes that dependency, and
InstallSidecarWriter.PrepareForSelfUpdate rewrites only
channel/version/commit, so the field survives the self-update.

This restores two behaviours the test was written to cover: that the
persisted identity channel lands in a project's aspire.config.json, and
the "AppHost predates the self-update" scenario users actually hit.

The second `aspire update --self` is dropped because it cannot coexist
with `packages`: once the sidecar's channel is staging, the synthesized
local-hive channel replaces the same-named built-in channel
(PackagingService.GetChannelsAsync) and a local hive has no
CliDownloadBaseUrl, so self-download fails with "Channel 'staging' does
not support CLI downloads". The project update asserts the same
persistence more strongly, via the resulting config.

Also drops the [QuarantinedTest] attribute added by #19733 while
resolving the merge with main, so the fix actually runs in CI.

Validated: 3 consecutive passing E2E runs against ASPIRE_E2E_ARCHIVE,
with quarantined and outerloop tests excluded. Recording confirms the
relaunched process is the published staging binary
(13.5.3+b5f143315ffb6968ea939a9978797a5b20e4c688), not a local no-op.
UpdateCommandTests theory: 4 passed.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754

* Improve package path processing

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>
Copilot-Session: 7e17da02-39b1-4fa1-ac25-144eb6fcb904
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754
David Pine (IEvangelist) pushed a commit that referenced this pull request Sep 3, 2026
* Fix Issue 19708

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 7e17da02-39b1-4fa1-ac25-144eb6fcb904

* Eliminate false positive

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Make the restore hermetic instead of dropping the project update

Restores the project-update leg of the test and makes its restore
hermetic via the install sidecar's `packages` field, rather than
removing the step that fails.

Without `packages`, the relaunched CLI derives its Aspire feed from the
identity it just persisted (darc-pub-microsoft-aspire-<commit>). Once
that staging build is promoted to GA the feed stops carrying a matching
Aspire.AppHost.Sdk, which is the reported failure in #19708. Pinning
`packages` at the harness hive removes that dependency, and
InstallSidecarWriter.PrepareForSelfUpdate rewrites only
channel/version/commit, so the field survives the self-update.

This restores two behaviours the test was written to cover: that the
persisted identity channel lands in a project's aspire.config.json, and
the "AppHost predates the self-update" scenario users actually hit.

The second `aspire update --self` is dropped because it cannot coexist
with `packages`: once the sidecar's channel is staging, the synthesized
local-hive channel replaces the same-named built-in channel
(PackagingService.GetChannelsAsync) and a local hive has no
CliDownloadBaseUrl, so self-download fails with "Channel 'staging' does
not support CLI downloads". The project update asserts the same
persistence more strongly, via the resulting config.

Also drops the [QuarantinedTest] attribute added by #19733 while
resolving the merge with main, so the fix actually runs in CI.

Validated: 3 consecutive passing E2E runs against ASPIRE_E2E_ARCHIVE,
with quarantined and outerloop tests excluded. Recording confirms the
relaunched process is the published staging binary
(13.5.3+b5f143315ffb6968ea939a9978797a5b20e4c688), not a local no-op.
UpdateCommandTests theory: 4 passed.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754

* Improve package path processing

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>
Copilot-Session: 7e17da02-39b1-4fa1-ac25-144eb6fcb904
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754
Eric Erhardt (eerhardt) added a commit that referenced this pull request Sep 3, 2026
## Description

Adds the `Aspire.Hosting.Azure.ConnectorNamespace` integration for Azure Connector Namespace resources (ARM resource type `Microsoft.Web/connectorGateways`).

This is a hardened port of the Connector Namespace portion of #17873, adapted to the current Azure provisioning pipeline, existing-resource APIs, workload references, and ATS exports.

### Included

- `Microsoft.Web/connectorGateways@2026-05-01-preview` provisioning
- connector connections and Microsoft Entra connection access policies
- user-assigned identity access policies without hard-coded principal IDs
- workload `WithReference` configuration for the Azure Connector SDK
- managed MCP server configurations, connector routes, explicit operation allow-lists, and caller access policies
- existing Connector Namespace, connection, and MCP configuration references
- TypeScript validation, README guidance, Bicep snapshots, and an opt-in live Azure deployment test

Generated C# and ATS compatibility baselines are intentionally not updated in this feature PR; those release baselines are generated separately by the repository's release process.

### Deferred

Connector triggers and event subscriptions are intentionally deferred. Incremental ARM deployments do not remove omitted or renamed `triggerConfigs` children, so safe support requires explicit lifecycle reconciliation and persistent deployed-trigger state rather than best-effort child deployments. #19809 tracks that follow-up.

### C# example

```csharp
var connectorNamespace = builder.AddAzureConnectorNamespace("connectors");
var outlook = connectorNamespace.AddConnection(
    "outlook",
    "office365",
    new AzureConnectorNamespaceConnectionOptions
    {
        ConnectionName = "office365-outlook",
        DisplayName = "Office 365 Outlook"
    });

builder.AddProject<Projects.Worker>("worker")
    .WithReference(outlook);

connectorNamespace.AddMcpServerConfig("outlook-mcp")
    .WithConnector(
        "office365",
        outlook,
        new AzureConnectorNamespaceMcpConnectorOptions
        {
            Operations =
            [
                new AzureConnectorNamespaceMcpOperationOptions { Name = "GetEmailsV3" }
            ]
        })
    .WithAccessPolicy(
        "developer-access",
        new AzureConnectorNamespaceMcpAccessPolicyOptions
        {
            ObjectId = "11111111-1111-1111-1111-111111111111",
            TenantId = "22222222-2222-2222-2222-222222222222",
            PrincipalType = AzureConnectorNamespaceMcpAccessPolicyPrincipalType.User
        });
```

### TypeScript example

```typescript
const connectorNamespace = await builder.addAzureConnectorNamespace("connectors");
const outlook = await connectorNamespace.addConnection("outlook", "office365", {
    connectionName: "office365-outlook",
    displayName: "Office 365 Outlook"
});

const worker = await builder.addContainer(
    "worker",
    "mcr.microsoft.com/dotnet/runtime-deps:10.0"
);
await worker.withReference(outlook);

const outlookMcp = await connectorNamespace.addMcpServerConfig("outlook-mcp");
await outlookMcp.withConnector("office365", outlook, {
    operations: [{ name: "GetEmailsV3" }]
});
await outlookMcp.withAccessPolicy("developer-access", {
    objectId: "11111111-1111-1111-1111-111111111111",
    tenantId: "22222222-2222-2222-2222-222222222222",
    principalType: AzureConnectorNamespaceMcpAccessPolicyPrincipalType.User
});
```

### Security considerations

- Aspire provisions connection resources but does not automate or store OAuth consent. Interactive authorization remains a user action in `connectors.azure.com`.
- MCP routes require an explicit operation allow-list; broad connector tool exposure is rejected.
- Connection and MCP access policies authorize only explicitly configured Microsoft Entra principals.
- Secret-valued connection parameter sets are intentionally unsupported; use an existing externally authorized connection instead.

### Validation

- 33 `AzureConnectorNamespaceTests` pass with quarantined and outerloop tests excluded
- `Aspire.Deployment.EndToEnd.Tests` builds with the guarded Connector Namespace deployment scenario
- Connector Namespace package creation succeeds
- TypeScript SDK generation and `tsc --noEmit` are covered by the polyglot validation fixture
- generated Bicep compiles and matches the verified snapshot
- `git diff --check` passes

Related: #19008, #19809
Original implementation source and credit: #17873 by @davidfowl

* feat: add Azure Container Apps Sandboxes target

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix: address Azure Sandboxes review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix: scope Azure sandbox cleanup ownership

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* test: make container output assertion portable

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* test: avoid cmd echo trailing whitespace

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix: configure sandbox build options on target creation

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address Azure Sandboxes review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Harden Azure Sandboxes APIs and retries

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Secure sandbox diagnostics and image inspection

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Strengthen image argument boundary tests

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address Azure Sandboxes deployment review

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address sandbox scope and cleanup review

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Fix sandbox group resource naming

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* fix(ats): support TimeSpan values in DTOs

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* docs(sandboxes): cite data owner role

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Fix polyglot sandbox ownership isolation

Use source AppHost file identity for deployment-state isolation while migrating legacy state paths, and derive sandbox ownership from the canonical AppHost identity. Keep publish-only sandbox resources out of run mode and document the TypeScript API.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Emit required sandbox group properties

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Fix deployment state migration path resolution

Co-authored-by: Copilot <[email protected]>
Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae

* Address Azure sandbox review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae

* Add Azure Connector Gateway integration

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Address Connector Gateway review feedback

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* chore: record stacked prerequisite update

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542

* Update Connector Gateway tests for rebased sandbox APIs

Co-authored-by: Copilot <[email protected]>
Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae

* Fix sandbox state and principal migration

Co-authored-by: Copilot <[email protected]>

* Address Azure sandbox follow-up review

Make publish helpers inert during run mode, prune previous generations when immutable images change, and reconcile create response-loss by deployment labels.\n\nCo-authored-by: Copilot <[email protected]>

* Isolate source AppHost deployment state

Co-authored-by: Copilot <[email protected]>

* Harden Azure sandbox deployment lifecycle

Co-authored-by: Copilot <[email protected]>

* Add typed container image inspection results

Co-authored-by: Copilot <[email protected]>

* Harden deployment state loading and replacement

Co-authored-by: Copilot <[email protected]>

* Clarify deployment state clearing messages

Co-authored-by: Copilot <[email protected]>

* Handle ADC role assignment propagation

Co-authored-by: Copilot <[email protected]>

* Preserve scalar state migration semantics

Co-authored-by: Copilot <[email protected]>

* Fix claimed parent migration authority

Co-authored-by: Copilot <[email protected]>

* Reject reserved connector policy collisions

Co-authored-by: Copilot <[email protected]>

* Preserve authoritative migrated section state

Co-authored-by: Copilot <[email protected]>

* Harden sandbox security replacement cleanup

Co-authored-by: Copilot <[email protected]>

* Classify role-less app-only Azure tokens

Co-authored-by: Copilot <[email protected]>

* Fix deployment state migration edge cases

Co-authored-by: Copilot <[email protected]>

* Preserve deployment state manager compatibility

Co-authored-by: Copilot <[email protected]>

* Address sandbox runtime review feedback

Co-authored-by: Copilot <[email protected]>

* Handle optional Azure user name claims

Co-authored-by: Copilot <[email protected]>

* Address Connector Gateway review feedback

Co-authored-by: Copilot <[email protected]>

* Prune retained sandboxes with runtime configuration

Co-authored-by: Copilot <[email protected]>

* Update Connector Gateway fingerprint tests

Co-authored-by: Copilot <[email protected]>

* Isolate deployment state identity from AppHost path

Co-authored-by: Copilot <[email protected]>

* Use deployment identity for sandbox ownership

Co-authored-by: Copilot <[email protected]>

* Canonicalize deployment paths by filesystem semantics

Co-authored-by: Copilot <[email protected]>

* Merge concurrent nested state additions

Co-authored-by: Copilot <[email protected]>

* Allow composite connection endpoints through sandbox egress

Co-authored-by: Copilot <[email protected]>

* Harden deployment state locking and clearing

Co-authored-by: Copilot <[email protected]>

* Prune retained sandboxes for modeled commands

Co-authored-by: Copilot <[email protected]>

* Use existing sandbox scope for cleanup

Co-authored-by: Copilot <[email protected]>

* Harden deployment state fallback merging

Co-authored-by: Copilot <[email protected]>

* Clarify existing sandbox identity support

Co-authored-by: Copilot <[email protected]>

* Harden deployment state load against edge cases from review

LoadDeploymentState now computes state paths inside the try/catch so an
environment name containing characters outside [a-zA-Z0-9_-] degrades to
skipping the best-effort load instead of throwing ArgumentException from
builder construction in publish mode.

FileDeploymentStateManager only locks and reads legacy state when the
legacy file exists. This avoids manufacturing a phantom legacy directory
and lock file for identities that never had legacy state (e.g. brand-new
source AppHosts on a clean machine) and avoids re-coupling sibling
AppHosts that share the legacy identity on that shared lock.

Adds regression tests that fail without each fix.

Co-authored-by: Copilot App <[email protected]>

* Disable SelfUpdateChannelPersistenceTests pending fix

The test fails in PR CI and is tracked by #19708, which has a separate
fix in progress. Mark it [ActiveIssue] so it does not block unrelated PRs.

Co-authored-by: Copilot App <[email protected]>

* Harden authoritative state recovery

Co-authored-by: Copilot <[email protected]>

* Revert SelfUpdateChannelPersistenceTests disable in favor of #19733

PR #19733 quarantines this test with [QuarantinedTest] linked to #19708,
which preserves quarantine-workflow coverage until the root cause is fixed
in #19731. Our earlier [ActiveIssue] change skipped the test everywhere
(including the quarantine workflow) and touched the same method, causing a
merge conflict. Remove it so #19733 owns disabling this test and this
branch leaves the file unchanged from base.

Co-authored-by: Copilot App <[email protected]>

* Fix response-loss cleanup cancellation assertion

Co-authored-by: Copilot <[email protected]>

* Address sandbox analyzer and endpoint feedback

Co-authored-by: Copilot <[email protected]>

* Address sandbox deployment review feedback

Co-authored-by: Copilot <[email protected]>

* Harden sandbox create reconciliation and egress

Co-authored-by: Copilot <[email protected]>

* Address sandbox cleanup and digest feedback

Co-authored-by: Copilot <[email protected]>

* Use managed identity for sandbox image pulls

Move ADC disk image creation to the V2 managed identity contract and keep sandbox-specific provisioning out of the shared Azure hosting infrastructure.

Co-authored-by: Copilot <[email protected]>

* Decouple connector triggers from Azure internals

Reuse the standard Bicep provisioning pipeline after sandbox deployment instead of depending on internal Azure hosting APIs.

Co-authored-by: Copilot <[email protected]>

* Stabilize response-loss visibility test

Allow enough reconciliation time for Windows timer granularity while retaining the one-millisecond poll interval.

Co-authored-by: Copilot <[email protected]>

* Clarify sandbox workload identities

Co-authored-by: Copilot <[email protected]>

* Address Connector Gateway review feedback

Co-authored-by: Copilot <[email protected]>

* Avoid Connector Gateway grants in run mode

Co-authored-by: Copilot <[email protected]>

* Exclude Connector Gateway children from manifests

Co-authored-by: Copilot <[email protected]>

* Require secured Connector Gateway trigger construction

Co-authored-by: Copilot <[email protected]>

* Validate Connector Gateway policy identifiers

Co-authored-by: Copilot <[email protected]>

* Exercise Sandbox ACR pull identity export

Co-authored-by: Copilot <[email protected]>

* Refine Connector Namespace API scope

Rename the public integration surface to Connector Namespace and defer trigger provisioning until lifecycle reconciliation can safely remove stale child resources.

Co-authored-by: Copilot <[email protected]>

* Reject unsupported connector namespace configurations

Prevent Bicep identifier collisions across Connector Namespace child resources and reject multiple connectors on a preview MCP server configuration.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f

* Fix Connector Namespace Bicep identifier collisions

Co-authored-by: Copilot <[email protected]>

* Address Connector Namespace review feedback

Handle existing namespace identity and location semantics, remove unnecessary experimental diagnostics, and use readable collision-resistant policy identifiers.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f

* Split Connector Namespace into dedicated package

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f

* Avoid enabling targeted role assignments

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f

* Remove duplicate Azure provisioning registration

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f

* Avoid Connector Namespace Bicep symbol collisions

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f

* Fix Connector Namespace resource name collisions

Co-authored-by: Copilot <[email protected]>

* Address Connector Namespace API feedback

Co-authored-by: Copilot <[email protected]>

* Add managed MCP access policies

Co-authored-by: Copilot <[email protected]>

* Validate Connector Namespace principal IDs

Co-authored-by: Copilot <[email protected]>

* Mark Connector Namespace APIs experimental

Co-authored-by: Copilot <[email protected]>

* Add Connector Namespace deployment coverage

Co-authored-by: Copilot <[email protected]>

* Add Connector Namespace workload references

Co-authored-by: Copilot <[email protected]>

* Enable Aspire Integration Analyzers in project file

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Clarify Connector Namespace workload authorization

Co-authored-by: Copilot <[email protected]>

* Minor PR feedback

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
Copilot-Session: 2fbe254b-3480-468c-99fa-428b6d207542
Copilot-Session: a759f61f-23ce-4579-935b-c0e48290edae
Copilot-Session: ccb1419b-3f5f-4cb3-8933-b0bb1762ed48
Copilot-Session: 3accecbc-b198-435e-8e5d-16f3c09d7d5f
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants