Skip to content

Print apphost exit message in debug console and add TypeScript Azure Functions playground sample#15155

Merged
adamint merged 8 commits intomicrosoft:release/13.2from
adamint:dev/adamint/print-apphost-exit-msg-and-ts-functions-sample
Mar 12, 2026
Merged

Print apphost exit message in debug console and add TypeScript Azure Functions playground sample#15155
adamint merged 8 commits intomicrosoft:release/13.2from
adamint:dev/adamint/print-apphost-exit-msg-and-ts-functions-sample

Conversation

@adamint
Copy link
Member

@adamint adamint commented Mar 12, 2026

Description

This PR contains two changes:

  1. Print a yellow informational message in the debug console when the AppHost process stops. When a debug session ends because the AppHost exits, a clearly-visible yellow message is now printed to the terminal/debug console to indicate the AppHost has stopped. This helps developers quickly notice that the AppHost has exited rather than silently disappearing.

  2. Add a TypeScript Azure Functions end-to-end playground sample. Adds playground/AzureFunctionsEndToEnd.TypeScript, demonstrating a TypeScript AppHost using the JavaScript app model with:

    • Azure Functions app (Node.js v4 programming model) with queue, blob, blob container, and Event Hubs triggers
    • TypeScript Express API service that references the Functions app and Azure Storage/Event Hubs resources
    • The existing AzureFunctionsEndToEnd.AppHost (C#) is updated to rename Program.cs to AppHost.cs

I added the informational message to make it more clear what happened and where to find console output for the apphost - after creating the sample, I was initially confused why the debug session immediately stopped after the TS apphost started (caused by an exception in the apphost).

image

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15155

Or

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

@adamint adamint marked this pull request as ready for review March 12, 2026 02:01
Copilot AI review requested due to automatic review settings March 12, 2026 02:01
@adamint adamint self-assigned this Mar 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the VS Code Aspire debugging experience by surfacing an explicit termination message when the AppHost stops, and adds a new TypeScript-based Azure Functions end-to-end playground sample to demonstrate the JavaScript app model with Azure emulators.

Changes:

  • Add a yellow informational message to the debug console when the AppHost debug session terminates (and isn’t being restarted).
  • Add a new playground/AzureFunctionsEndToEnd.TypeScript sample including a TypeScript AppHost, a TypeScript Azure Functions app, and a TypeScript Express API service.
  • Rename the C# Azure Functions E2E AppHost entrypoint from Program.cs to AppHost.cs.

Reviewed changes

Copilot reviewed 22 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
playground/AzureFunctionsEndToEnd/AzureFunctionsEndToEnd.AppHost/AppHost.cs Renamed/added C# AppHost entrypoint for the existing Azure Functions E2E playground.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/tsconfig.json TypeScript compiler settings for the Functions app.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/src/functions/queueTrigger.ts Adds a queue trigger function (storage queues).
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/src/functions/httpTrigger.ts Adds an HTTP-triggered function endpoint.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/src/functions/eventHubTrigger.ts Adds an Event Hubs trigger function.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/src/functions/blobTrigger.ts Adds a blob trigger with an output binding.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/package.json Defines Functions app dependencies and scripts.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/package-lock.json Lockfile for the Functions app.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/host.json Azure Functions host configuration (logging/telemetry).
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptApiService/tsconfig.json TypeScript compiler settings for the Express API service.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptApiService/src/app.ts Express API that publishes to queue/blob/event hubs and calls the Functions HTTP endpoint.
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptApiService/package.json Defines API service dependencies and scripts (tsx dev workflow).
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptApiService/package-lock.json Lockfile for the API service.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/tsconfig.json TypeScript compiler settings for the TypeScript AppHost.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/package.json AppHost Node/TS package definition and scripts.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/package-lock.json Lockfile for the AppHost package.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/apphost.ts TypeScript AppHost wiring storage + event hubs + JS apps and references.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/apphost.run.json Run profile settings for the TypeScript AppHost sample.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/.modules/transport.ts Generated ATS transport layer used by the TypeScript AppHost.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/.modules/base.ts Generated ATS base types/helpers used by the TypeScript AppHost.
playground/AzureFunctionsEndToEnd.TypeScript/AppHost/.modules/.codegen-hash Tracks generated module version/hash for the TypeScript AppHost.
playground/AzureFunctionsEndToEnd.TypeScript/.vscode/launch.json Adds a VS Code launch configuration for the new sample.
extension/src/utils/AspireTerminalProvider.ts Adds ANSI yellow color constant for styled output.
extension/src/loc/strings.ts Adds localized string for AppHost-terminated debug console message.
extension/src/debugger/AspireDebugSession.ts Emits a yellow info message to the debug console when the AppHost session terminates.
extension/package.nls.json Adds localization entry for the new AppHost-terminated message.
Files not reviewed (3)
  • playground/AzureFunctionsEndToEnd.TypeScript/AppHost/package-lock.json: Language not supported
  • playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptApiService/package-lock.json: Language not supported
  • playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/package-lock.json: Language not supported

You can also share your feedback on Copilot code review. Take the survey.

}

app.eventHub("eventHubTrigger", {
connection: "eventhubs",
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

In the existing C# AzureFunctionsEndToEnd sample, the Event Hubs trigger uses the hub resource name as the connection setting prefix (Connection = "myhub"). Here the trigger is configured with connection: "eventhubs", which is the namespace resource name and likely won’t match the settings produced by .addHub("myhub") / .withReference(eventHub). Update the trigger to use the hub connection prefix that Aspire will provide (e.g., "myhub"), keeping the resource naming consistent across the sample.

Suggested change
connection: "eventhubs",
connection: "myhub",

Copilot uses AI. Check for mistakes.
@adamint adamint enabled auto-merge (squash) March 12, 2026 02:50
@adamint adamint merged commit 8ae684d into microsoft:release/13.2 Mar 12, 2026
510 of 522 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants