Print apphost exit message in debug console and add TypeScript Azure Functions playground sample#15155
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15155Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15155" |
There was a problem hiding this comment.
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.TypeScriptsample 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.cstoAppHost.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", |
There was a problem hiding this comment.
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.
| connection: "eventhubs", | |
| connection: "myhub", |
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptApiService/src/app.ts
Outdated
Show resolved
Hide resolved
playground/AzureFunctionsEndToEnd.TypeScript/TypeScriptFunctions/package.json
Outdated
Show resolved
Hide resolved
…nv var, and package.json main field
Description
This PR contains two changes:
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.
Add a TypeScript Azure Functions end-to-end playground sample. Adds
playground/AzureFunctionsEndToEnd.TypeScript, demonstrating a TypeScript AppHost using the JavaScript app model with:AzureFunctionsEndToEnd.AppHost(C#) is updated to renameProgram.cstoAppHost.csI 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).
Checklist