Skip to content

[release/17.0] Fix Visual Studio debugging for Azure Functions projects - #22401

Merged
Jose Perez Rodriguez (joperezr) merged 7 commits into
release/17.0from
backport/pr-22346-to-release/17.0
Nov 23, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 7 commits into
release/17.0from
backport/pr-22346-to-release/17.0

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Backport of #22346 to release/17.0

/cc Karol Zadora-Przylecki (@karolz-ms)

Customer Impact

Testing

Risk

Regression?

@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 -- 22401

Or

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

@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Nov 18, 2026
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An out-of-scope extensionEndpoint prevents test-project compilation, while incorrect launch-type assertions and a resolver regression that drops launch-profile arguments also remain.

5 open issues
What changed in this PR

Backports #22346 to release/17.0 to restore Visual Studio debugging for Azure Functions projects through Aspire’s native project launcher.

Changes:

  • Centralizes IDE launch decisions while preserving extension-advertised capabilities.
  • Preserves Azure Functions launch-profile arguments during compatibility launches.
  • Updates launch metadata handling, documentation, and regression tests.
File Description
tests/​Aspire.Hosting.Tests/​DebugSupportExtensionsTests.cs Tests effective launch types and compatibility restrictions.
tests/​Aspire.Hosting.Tests/​Dcp/​ResourceSnapshotBuilderTests.cs Tests IDE metadata and sensitive argument handling.
tests/​Aspire.Hosting.Tests/​Dcp/​ExecutableLaunchPlanTests.cs Checks launch-tool argument retention during compatibility launches.
tests/​Aspire.Hosting.Tests/​Dcp/​DcpExecutorTests.cs Adds launch-routing and Azure Functions argument scenarios.
tests/​Aspire.Hosting.Tests/​Aspire.Hosting.Tests.csproj References the Azure Functions integration for testing.
src/​Aspire.Hosting/​SupportsDebuggingAnnotation.cs Marks synthesized compatibility annotations and documents their behavior.
src/​Aspire.Hosting/​ResourceBuilderExtensions.cs Clarifies launch-tool argument ownership in documentation.
src/​Aspire.Hosting/​Dcp/​ResourceSnapshotBuilder.cs Restricts native project metadata to suitable IDE launches.
src/​Aspire.Hosting/​Dcp/​ExecutableLaunchPolicy.cs Uses the shared effective debug-support decision.
src/​Aspire.Hosting/​ApplicationModel/​ExecutableLaunchRecipe.cs Preserves profile arguments for Azure Functions compatibility launches.
src/​Aspire.Hosting/​ApplicationModel/​DebugSupportExtensions.cs Implements shared launch selection and compatibility rules.

Review effort: Max

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@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.

@karolz-ms

Karol Zadora-Przylecki (karolz-ms) commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

All the failures and code review findings are caused by the fact the changes from main branch were incorrectly applied when this PR was created. Fixing... Fixed.

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The release backport changes core IDE launch routing and public SupportsDebugging semantics, requiring human servicing review given missing VS/VS Code runtime validation and empty shiproom impact, testing, and risk sections.

1 open issue
4 resolved since last review

Review effort: Max

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@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.

@karolz-ms
Karol Zadora-Przylecki (karolz-ms) changed the base branch from release/17.0 to dev/karolz/release-17-e2e-test-stability November 18, 2026 23:53
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@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.

Base automatically changed from dev/karolz/release-17-e2e-test-stability to release/17.0 November 20, 2026 16:23
Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 20, 2026
## Description

Test-only change for `release/17.0`. It fixes CLI E2E failures that show
up on unrelated release PRs (for example #22401 and #22362). There are
no product changes.

**1. ConfigSource brownfield adoption test.** This ports only the
`ConfigSourceTestContext` test fix from #22182, which is already merged
on `main` and is also part of the open backport #22219.
`Update_AcceptingConfigurationSourceUpdatesBrownfieldConfiguration`
assumed the old SDK version and an exact JSON property order. With this
change, the test:
- runs `aspire update --yes --nuget-config-dir .`
- sets the expected `sdk.version` from the AppHost
- compares the result with `JsonNode.DeepEquals`

**2. Post-update CLI self-update prompt.** After the project update,
`aspire update` may ask `An update is available for the Aspire CLI.
Would you like to update it now? [Y/n]`.
`features.updateNotificationsEnabled` does not control this prompt. It
appears only when a newer CLI has been published on the selected
channel. Four tests blocked on it until they timed out:
-
`CentralPackageManagementTests.AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps`
-
`CentralPackageManagementTests.AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent`
-
`ChannelUpdateWorkflowTests.UpdateToStable_TypeScriptSingleFileInit_KeepsConfigChannel`
-
`ChannelUpdateWorkflowTests.UpdateToStable_TypeScript_PreviewsStablePkgsAndKeepsChannel`

The new `CliE2EAutomatorHelpers.WaitForAspireUpdateCompletionAsync`
helper waits until one of three things appears for the current
`SequenceCounter` value:
- the success prompt
- the error prompt, which still fails fast
- the CLI self-update prompt

Only output after the line where the command was typed is considered, so
a prompt left on screen by an earlier `aspire update` in the same test
does not count. When the CLI self-update prompt appears, the helper
types `n` without Enter, so no phantom shell command desyncs the
counter, and then waits for the success prompt. It does not press Enter
blindly or use fixed delays, and it works whether or not the prompt
appears. The comments that claimed `updateNotificationsEnabled`
suppresses this prompt have been corrected.

### Validation

- `MSBUILDTERMINALLOGGER=false dotnet build
tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj -v q
-nologo` succeeded with 0 warnings and 0 errors.
- The affected E2E tests were **not run locally**: they need Docker plus
a Linux CLI archive, and Docker isn't available on the authoring
machine. The CLI E2E jobs in this PR's CI provide that validation.
- Root cause comes from the asciinema recordings and TRX files of CI run
44398134189 (#22401). In all four failures the terminal is blocked at
the CLI self-update `[Y/n]` prompt.

Fixes # (issue)

## 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 App <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

52 / 101 PR test projects · 4 PR jobs, from 11 changed files.

Selected PR test projects (52 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 46 of the 52 selected test projects come from a single change — src/Aspire.Hosting/ApplicationModel/DebugSupportExtensions.cs.

🔧 src/Aspire.Hosting/ApplicationModel/DebugSupportExtensions.cs (changed source)
→ 46 via the project graph

show 46

Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.EntraId.Tests (2 hops), Aspire.Hosting.Azure.Kubernetes.Tests (2 hops), Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (3 hops), Aspire.Hosting.Azure.Tests, Aspire.Hosting.Browsers.Tests (2 hops), Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests (2 hops), Aspire.Hosting.DevTunnels.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.EntityFrameworkCore.Tests (2 hops), Aspire.Hosting.Foundry.Tests (2 hops), Aspire.Hosting.Garnet.Tests (2 hops), Aspire.Hosting.Go.Tests (2 hops), Aspire.Hosting.Java.Tests (2 hops), Aspire.Hosting.JavaScript.Tests (2 hops), Aspire.Hosting.Kafka.Tests (2 hops), Aspire.Hosting.Keycloak.Tests (2 hops), Aspire.Hosting.Kubernetes.Tests (2 hops), Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests (2 hops), Aspire.Hosting.MongoDB.Tests (2 hops), Aspire.Hosting.MySql.Tests (2 hops), Aspire.Hosting.Nats.Tests (2 hops), Aspire.Hosting.OpenAI.Tests (2 hops), Aspire.Hosting.Oracle.Tests (2 hops), Aspire.Hosting.Orleans.Tests (2 hops), Aspire.Hosting.PostgreSQL.Tests (2 hops), Aspire.Hosting.Python.Tests (2 hops), Aspire.Hosting.Qdrant.Tests (2 hops), Aspire.Hosting.RabbitMQ.Tests (2 hops), Aspire.Hosting.Redis.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests (2 hops), Aspire.Hosting.Seq.Tests (2 hops), Aspire.Hosting.SqlServer.Tests (2 hops), Aspire.Hosting.Testing.Tests (2 hops), Aspire.Hosting.Valkey.Tests (2 hops), Aspire.Hosting.Yarp.Tests (2 hops), Aspire.Playground.Tests

🧪 tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj (changed test)
→ 1 directly: Aspire.Hosting.Tests
→ 3 via the project graph: Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.Radius.Tests

📦 affected project Aspire.Hosting.Dotnet
→ 2 tests: Aspire.Cli.EndToEnd.Tests, Aspire.Templates.Tests

📦 affected project Aspire.Hosting
→ 1 test: Aspire.Cli.EndToEnd.Tests

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

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

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

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

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Hosting.Go
extension-e2e • src/Aspire.Hosting/ApplicationModel/DebugSupportExtensions.cs, src/Aspire.Hosting/ApplicationModel/ExecutableLaunchRecipe.cs, src/Aspire.Hosting/Dcp/ExecutableLaunchPolicy.cs, src/Aspire.Hosting/Dcp/ResourceSnapshotBuilder.cs, src/Aspire.Hosting/ResourceBuilderExtensions.cs, src/Aspire.Hosting/SupportsDebuggingAnnotation.cs
• affected project Aspire.Hosting
polyglot • affected project Aspire.Hosting
• affected project Aspire.Hosting.Azure.Provisioning.KeyVault
typescript-api-compat affected project Aspire.Hosting

Selection computed for commit 928bbc8.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@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.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 5399d19 into release/17.0 Nov 23, 2026
1390 of 1406 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 23, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

excluded → backport. Exclusion reasons: base_branch_is_release, head_branch_is_backport, title_release_prefix, body_backport_marker (title is prefixed [release/17.0], body says "Backport of #22346"). Triggered signal: experimental_attribute_added (DebugSupportExtensions.cs). Docs belong on the original forward PR #22346.

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

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants