You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add TypeScript Azure Functions app support - #17980
This adds a proof-of-concept path for Azure Functions apps that are not .NET projects, starting with TypeScript and JavaScript on the Node worker. The goal is to let a TypeScript AppHost model, run, publish, and deploy a TypeScript Azure Functions app the same way it models the rest of a distributed app.
The change introduces a directory-based Azure Functions app resource, local Core Tools launch behavior, and deterministic Dockerfile publishing for TypeScript/JavaScript Functions containers.
VS Code debugger support was split into the stacked follow-up #20943 so the hosting and deployment support can land independently.
A new playground sample demonstrates the scenario end to end: a TypeScript AppHost, TypeScript Azure Function, Azure Storage dependency, and Vite TypeScript frontend. Locally, the frontend proxies /api to the Aspire-modeled Functions endpoint. In Azure Container Apps, the frontend is published as a static site with /api routed to the Functions container.
Generated TypeScript Functions Dockerfile publish uses the official Functions Node host image shape, builds TypeScript during container build, and exposes container port 80 for ACA kind: functionapp deployment.
Security considerations
This change adds support for launching Node-based Azure Functions apps locally and publishing them as containers. The sample frontend adds a static-site reverse proxy route from /api to the Functions resource. Security review has not been completed yet because this is a POC.
Clean isolated local aspire start for the TypeScript AppHost
aspire wait functions and aspire wait frontend
Local frontend /api/storageHttpTrigger?name=Frontend call wrote a blob to the modeled samples container
aspire publish emitted Functions and frontend container artifacts, including ACA Bicep, Functions kind: 'functionapp', target port 80, frontend YARP static-site routing, and storage role assignments
Real aspire deploy to ACA in rg-aspire-ts-functions-poc succeeded
Deployed frontend /api/storageHttpTrigger?name=ACAFrontend returned HTTP 200 and wrote a blob
Passed: git diff --check
Fixes # (issue)
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?
Remove the modeled Node inspector endpoint from directory-based Azure Functions apps and keep inspector setup inside VS Code debug launches. The extension now allocates a per-session loopback inspector port, injects the documented Functions worker argument only for debug, and attaches with js-debug.
Co-authored-by: Copilot <[email protected]>
Re-running the failed jobs in the CI workflow for this pull request because 2 jobs were identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.
Tests / Run VS Code extension unit tests (Windows) - Test execution failure will be retried because 1 failed test(s) matched transient test failure patterns (Unable to access container registry during publish).
Make the Azure Functions Node debugger test expect the same path separator normalization used by path.join so it passes on Windows and Unix.
Co-authored-by: Copilot <[email protected]>
Expose host storage for directory-based Functions apps to polyglot AppHosts, avoid requiring global Core Tools for TypeScript apps that run through npm, refine Node debug source-map defaults, and document the JS/TS Functions path.
Co-authored-by: Copilot <[email protected]>
Adds proof-of-concept TypeScript/JavaScript Azure Functions support across Aspire hosting, Azure Container Apps publishing, VS Code debugging, and an end-to-end playground.
Changes:
Adds directory-based Node Functions resources, storage integration, and Dockerfile publishing.
Adds VS Code Node inspector launch/attach support.
Adds hosting tests, documentation, and a storage-backed TypeScript sample.
WithRequiredCommand only checks that npm exists; it does not install the app's packages. On a clean checkout, the documented TypeScript path runs npm run start, whose prestart/start scripts require local typescript and azure-functions-core-tools, and JavaScript apps likewise need their @azure/functions dependency. The new sample therefore cannot run until the user manually runs npm install, unlike AddJavaScriptApp, which creates an installer resource and waits for it. Add an npm install setup dependency (or an equivalent explicit package-install lifecycle) before launching the Functions resource.
Validate the public appDirectory constructor argument
The public constructor renames the base workingDirectory parameter to appDirectory but passes it through without validation. ExecutableResource permits an empty working directory, and a null value throws with ParamName == "workingDirectory", which does not name any parameter on this API (the new test currently locks in that mismatch). Validate appDirectory before passing it to the base constructor so null/empty values report appDirectory, matching AddAzureFunctionsApp.
This documents Node Functions debugger behavior that is not present in this PR: the description explicitly says it was split into #20943, and the current extension has no azure-functions-node/languageWorkers__node__arguments implementation. As merged independently, users would be promised a VS Code attach flow that does not exist. Document the current limitation until the follow-up lands.
The 45-minute outer cancellation is shorter than this test's own permitted phases: bundle installation can take 5 minutes, init and three package adds allow 11 minutes, deploy allows 30 minutes, and verification allows 12 minutes. A valid slow deployment can therefore be canceled by the outer token before any individual phase times out. Increase the outer budget to cover those phases plus cleanup margin.
The PR's user-facing snippet uses withReference(samples), but the included Functions code declares its storage binding with connection blobs. A blob-container resource does not provide the Functions-specific blobs__blobServiceUri configuration, so copying the documented snippet with this app will fail at runtime. Update the PR description to reference blobs as this implementation does, while waiting for samples separately.
Document Node Functions debugger support as unavailable
The PR explicitly says Node Functions debugger support was split into follow-up #20943, but this README describes that extension behavior as available now. Until the follow-up lands, users following this documentation will expect an automatic inspector launch and attach flow that this change does not provide. Document the current limitation instead.
This documents automatic Node inspector setup and debugger attachment, but the PR description explicitly says that VS Code debugger support was split into follow-up #20943 so this hosting change can land independently. If this PR lands first, users will be promised behavior that is not present. Remove the Node-debugging claims here (or state that automatic debugging is not included) until the follow-up lands.
- Document AddAzureFunctionsApp, AzureFunctionsAppResource, and
AzureFunctionsLanguage for directory-based TypeScript/JavaScript
Functions apps in the Azure Functions Hosting integration page.
- Add the ASPIREAZUREFUNCTIONS001 diagnostic reference page and
register it in the reference sidebar.
- Document directory-based Functions app Dockerfile publishing and
Azure Container Apps functionapp kind deployment behavior.
Documents changes from microsoft/aspire#17980
Co-authored-by: Copilot <[email protected]>
Documents the new TypeScript/JavaScript Azure Functions app support added in #17980 (triggered signals: new_public_type — AzureFunctionsLanguage enum; experimental_attribute_added — [Experimental("ASPIREAZUREFUNCTIONS001")] on the new app resource/APIs; integration_readme_changed and diagnostic_documentation_changed — README and docs/list-of-diagnostics.md both updated; pr_body_has_user_facing_section/pr_body_has_cli_flag_mention — the PR body's "User-facing usage" section shows addAzureFunctionsApp/AddAzureFunctionsApp).
Changes:
integrations/cloud/azure/azure-functions/azure-functions-host.mdx: new "TypeScript and JavaScript Functions apps" section documenting AddAzureFunctionsApp/addAzureFunctionsApp, AzureFunctionsLanguage, host storage, and the experimental-API opt-in; new "Deploying TypeScript and JavaScript Functions apps" subsection documenting generated Dockerfile behavior and the ACA functionapp container kind; a pointer note added to the existing "Add Azure Functions resource" section.
diagnostics/aspireazurefunctions001.mdx (new): reference page for the new ASPIREAZUREFUNCTIONS001 experimental diagnostic, mirroring the existing ASPIREDURABLETASK001/ASPIREDOCKERFILEBUILDER001 pages.
config/sidebar/reference.topics.ts: registers the new diagnostic page in the sidebar.
## Description
Adds the VS Code extension debugger follow-up split from #17980 so
TypeScript and JavaScript Azure Functions apps can be launched under
Core Tools and attached with the Node debugger.
The parent #17980 has merged. This PR targets `main` and preserves the
parent's final constructor validation, deployment subscription handling,
and `.npmrc` build-context exclusion.
Restores effective environment propagation, inspector-port reservation
through task launch, separate Node Functions E2E prerequisites,
handled-exception diagnostics, documentation, and tests.
The external-consumer Node Functions E2E fixture uses
`Microsoft.NET.Sdk`, `AspireUseCliBundle`, and matching PR-built
`Aspire.Hosting.AppHost` and `Aspire.Hosting.Azure.Functions` packages.
It does not reference the repository project, avoiding mixed
repository-central and external transitive Azure Storage versions. The
fixture gets its package version from the E2E runner instead of assuming
the generated template contains the now-deprecated `Aspire.AppHost.Sdk`
directive.
### User-facing usage
With the Aspire VS Code extension installed, debugging an AppHost
containing a TypeScript or JavaScript Azure Functions app starts Azure
Functions Core Tools, reserves a loopback Node inspector port until task
launch, attaches `pwa-node`, and stops the task when the debug session
ends.
The playground launch configuration demonstrates the scenario with
`AzureFunctionsWithStorage`.
Screenshots are not useful evidence for this debugger-orchestration
change. The [passing live Node Functions E2E
proof](https://github.com/microsoft/aspire/actions/runs/38341117446/job/115117157380)
installs real source breakpoints, sends an HTTP request, verifies the
`pwa-node` stack frame, and verifies Core Tools and the inspector are
cleaned up.
### Validation
[CI run
38341117446](https://github.com/microsoft/aspire/actions/runs/38341117446)
passed for head `2ea2231f0fae7f3cd2c3d89a614a06fc7de3cb51`, including
the live Node Functions debugger E2E and final results gate. All 104
visible PR checks finished successfully or were intentionally skipped;
none remain pending or failing.
Local validation after the package-based fixture fix:
- Passed: `cd extension && corepack yarn run compile-e2e`
- Passed: `cd extension && corepack yarn run compile-tests`
- Passed: `cd extension && corepack yarn run lint`
- Passed (170 tests): `cd extension && corepack yarn run unit-test
--grep "Azure Functions|E2E launch profile|E2E shard matrix"`
Earlier post-rebase validation:
- Passed (3,665 tests; 16 pending, plus compile and lint): `cd extension
&& corepack yarn test`
- Passed (1 test, including project build): `export
PATH="$PWD/.dotnet:$PATH" && dotnet test --project
tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj
--no-launch-profile -- --filter-method
"*.AddAzureFunctionsApp_DoesNotModelNodeDebugEndpoint"
--filter-not-trait "quarantined=true" --filter-not-trait
"outerloop=true"`
Initial validation also passed `./restore.sh` and `export
PATH="$PWD/.dotnet:$PATH" && dotnet build
src/Aspire.Hosting.Azure.Functions/Aspire.Hosting.Azure.Functions.csproj
/p:SkipNativeBuild=true --no-restore`.
Host limitation: an initial combined build attempt encountered
Xcode-dependent CLI/dashboard targets on this macOS host, which has
Command Line Tools rather than full Xcode. Local targeted validations
passed independently, and the current CI run passed its selected builds
and tests.
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]>
Copilot-Session: 36c01d16-3dc7-4ef2-80cc-1a0f40c862ca
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds a proof-of-concept path for Azure Functions apps that are not .NET projects, starting with TypeScript and JavaScript on the Node worker. The goal is to let a TypeScript AppHost model, run, publish, and deploy a TypeScript Azure Functions app the same way it models the rest of a distributed app.
The change introduces a directory-based Azure Functions app resource, local Core Tools launch behavior, and deterministic Dockerfile publishing for TypeScript/JavaScript Functions containers.
VS Code debugger support was split into the stacked follow-up #20943 so the hosting and deployment support can land independently.
A new playground sample demonstrates the scenario end to end: a TypeScript AppHost, TypeScript Azure Function, Azure Storage dependency, and Vite TypeScript frontend. Locally, the frontend proxies
/apito the Aspire-modeled Functions endpoint. In Azure Container Apps, the frontend is published as a static site with/apirouted to the Functions container.Related to #17979
User-facing usage
TypeScript AppHost:
Generated TypeScript Functions Dockerfile publish uses the official Functions Node host image shape, builds TypeScript during container build, and exposes container port 80 for ACA
kind: functionappdeployment.Security considerations
This change adds support for launching Node-based Azure Functions apps locally and publishing them as containers. The sample frontend adds a static-site reverse proxy route from
/apito the Functions resource. Security review has not been completed yet because this is a POC.Validation
./restore.shdotnet test --project tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-class "*.AzureFunctionsTests" --filter-class "*.FunctionsPublicApiTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"dotnet build tests/Aspire.Deployment.EndToEnd.Tests/Aspire.Deployment.EndToEnd.Tests.csproj --no-restore --nologoaspire startfor the TypeScript AppHostaspire wait functionsandaspire wait frontend/api/storageHttpTrigger?name=Frontendcall wrote a blob to the modeledsamplescontaineraspire publishemitted Functions and frontend container artifacts, including ACA Bicep, Functionskind: 'functionapp', target port 80, frontend YARP static-site routing, and storage role assignmentsaspire deployto ACA inrg-aspire-ts-functions-pocsucceeded/api/storageHttpTrigger?name=ACAFrontendreturned HTTP 200 and wrote a blobgit diff --checkFixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?